NEWS

PHP2Shell: Emergency Patches Fix Two Critical PHP RCE Flaws

PHP shipped 8.5.12, 8.4.27, 8.3.36 and 8.2.35 to fix CVE-2026-109618 and CVE-2026-109619, unauthenticated RCE bugs Cloudflare says are already being probed.

Dylan H.

News Desk

October 21, 2026
4 min read
PHP2Shell: Emergency Patches Fix Two Critical PHP RCE Flaws

Overview

The PHP security team released emergency patches on October 21, 2026 for two critical remote code execution vulnerabilities tracked together as PHP2Shell: CVE-2026-109618 and CVE-2026-109619. Both are rated CVSS v4.0 9.2, are unauthenticated, and stem from PHP leaving memory in a corrupted state when a request ends abnormally.

The release was announced a day early, on October 20, as an out-of-cycle update for 14:00 UTC on October 21. Details leaked before then, and a proof-of-concept tool called PHP2Shell, which gave the flaws their nickname, was already circulating. watchTowr says it reproduced CVE-2026-109618 from the leaked information.

The flaws were found by researchers from Calif, Wiz, and OpenAI. Krebs on Security warned that the patch may cause site outages as roughly 70 percent of websites scramble to update core software.

The Vulnerabilities

CVEDescription
CVE-2026-109618RCE as the web worker account via a chain of weaknesses that trigger out-of-memory corruption
CVE-2026-109619Stale global state enabling unauthenticated heap use-after-free, memory disclosure, and RCE

Every PHP installation that serves web requests is affected, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. The PHP team considers mod_php the highest risk: a demonstrated exploit lets an unauthenticated request trigger the attack before any application code runs.

Sansec says the bugs reach back to PHP 5.4, so long-retired installs are exposed too, not just the supported branches. Early community analysis pointed at session.upload_progress handling reached through crafted multipart/form-data POST requests, which matches the CVE-2026-109619 mitigation below.

Exploitation Status

Cloudflare's CTO said the company was already seeing early attacks against both flaws before the patches shipped, and deployed temporary WAF rules for known exploitation methods. The UK NCSC urged organizations to update immediately or take affected systems offline. VirusTotal estimates more than 5.1 million PHP hosts are exposed online.

Fixed Versions

  • PHP 8.5.12
  • PHP 8.4.27
  • PHP 8.3.36
  • PHP 8.2.35

PHP 8.1 and older no longer receive upstream updates. The PHP team published minimal source backports for 7.4, 8.0, and 8.1 for those building from source, and some distributions and LTS vendors ship their own backports, so check with your vendor.

Partial Mitigations

Patching is the only full fix. Until then:

CVE-2026-109618

  • Set memory_limit=-1, ideally via php_admin_value so applications cannot override it
  • Set a low post_max_size (8M without uploads, 32M with)
  • Apply a container or cgroup limit that kills only the affected worker

CVE-2026-109619

  • Set session.upload_progress.enabled=0 and restart all workers
  • On PHP 8.5, set fatal_error_backtraces=0 and restart workers
  • Fix attacker-reachable fatal errors and execution timeouts

Hiding errors with error_reporting, display_errors, or @ does not help. Where a host cannot be patched or reconfigured quickly, WAF or web-server rules that restrict multipart POST requests to PHP endpoints reduce exposure; a community Apache rule set exists for this.

  1. Inventory PHP exposure, including legacy and end-of-life hosts, CMS platforms, and containers that bundle PHP
  2. Upgrade to a fixed PHP release now, prioritizing mod_php and internet-facing hosts
  3. Restart all PHP workers after patching
  4. Apply the interim settings above where patching must wait
  5. Hunt for compromise since October 20: anomalous requests, worker crashes, new web shells, unexpected child processes of PHP-FPM or the web server, and outbound connections from web hosts
  6. Migrate off unsupported PHP branches

Why It Matters

PHP runs a large share of the web, including WordPress, Magento, and countless custom applications. A pre-authentication RCE with a public proof of concept and a leaked disclosure window gave attackers a head start, and scanning began before the patches shipped.

Sources