PHP powers roughly 70% of the internet. On October 21, 2026, the PHP project dropped an emergency patch for two unauthenticated remote code execution vulnerabilities rated CVSS 9.2. Exploitation was already in the wild before the patch landed. If you run PHP anywhere, this is a drop-everything patch.


TL;DR

NicknamesPHP2Shell
CVEsCVE-2026-109618, CVE-2026-109619
CVSS9.2 (Critical) — both
Auth requiredNone
Exploit in wildYes — confirmed Oct 21, 2026
AffectedPHP 5.4.0 through current (pre-patch)
Fixed8.5.12 / 8.4.27 / 8.3.36 / 8.2.35
Mitigation via configNone. Patch is the only fix.

What Is PHP2Shell?

PHP2Shell is the name watcthTowr gave to a pair of critical vulnerabilities in PHP’s core engine. They were discovered by researchers at Calif, with frontier AI models playing a significant role in making the exploit chain practical. Wiz and OpenAI were also credited.

Both flaws live in PHP itself — not in a specific application. That means WordPress, Drupal, Joomla, Laravel, Magento, and any other PHP-based platform running the vulnerable version is exposed, even if the application’s own code is perfectly secure.

Successful exploitation gives an unauthenticated attacker remote code execution with the web worker’s privileges. CVE-2026-109619 also allows memory disclosure — which can expose passwords, API keys, authentication tokens, and TLS certificates from other requests or the server process itself.


The Two CVEs Explained

CVE-2026-109618 — OOM Corruption RCE (CVSS 9.2)

This one is about what happens when PHP runs out of memory at the wrong moment.

When PHP processes a request, it initializes internal request data structures. If a memory allocation fails mid-setup, PHP aborts — but the cleanup code that runs afterwards trusts that data as valid. The result: partially initialized structures get treated as legitimate, and an attacker can manipulate that corrupted state into code execution.

The attack vector: crafted multipart requests (used for forms and file uploads) can exhaust PHP’s memory even when request size appears within configured limits. The attacker triggers the OOM condition deliberately.

Highest risk: Apache mod_php. Under mod_php, the cleanup runs even when request startup fails — meaning RCE can land before a single line of application code executes. PHP-FPM terminates the worker on startup failure, which blocks this specific path, though FPM has its own exposure through CVE-2026-109619.

CVE-2026-109619 — Stale Global State / Use-After-Free (CVSS 9.2)

PHP reuses worker processes across multiple HTTP requests. This CVE is about what happens when one request leaves behind state that the next request shouldn’t see.

After a request ends, some internal state still points to memory that’s already been freed. A subsequent request handled by the same PHP worker can access that stale pointer before normal initialization clears it. Fatal errors — including memory exhaustion and execution timeouts — can interrupt the cleanup that would reset this state. Even some nonfatal diagnostics during shutdown can repopulate error state after it was cleared.

Confirmed attack paths:

  • Fatal error backtrace feature (mod_php, fatal_error_backtraces enabled by default): a later initialization diagnostic accesses stale backtrace state → RCE
  • Session lifecycle (mod_php and PHP-FPM): session upload progress tracking creates a cross-request state condition → RCE
  • Also: memory disclosure through the same stale-pointer access

Both vulnerabilities are network-reachable, require no authentication, and require no user interaction.


Timeline

DateEvent
Oct 17Amazon Threat Intelligence observes first exploitation attempt — four days before public disclosure
Oct 20CVE identifiers leak on Hacker News and social media ahead of planned Oct 22 disclosure
Oct 20PHP security team announces emergency release scheduled for Oct 21, 14:00 UTC
Oct 20CERT-EU publishes advisory 2026-018
Oct 21 14:00 UTCPHP releases patches; publishes advisories
Oct 21watchTowr confirms exploitation in the wild via global honeypot network
Oct 21Multiple PoC exploits begin circulating publicly
Oct 22CISA issues alert (CVE not yet in KEV catalog as of Oct 22)
Oct 23Amazon Threat Intelligence: “broadly exploited in the wild”

Pre-patch exploitation started on October 17 — four days before the fix existed. Defenders had no window.


Affected Versions

Every PHP installation that serves web requests is in scope.

PHP BranchAffectedFixed Version
PHP 8.5.x< 8.5.128.5.12
PHP 8.4.x< 8.4.278.4.27
PHP 8.3.x< 8.3.368.3.36
PHP 8.2.x< 8.2.358.2.35
PHP 7.4, 8.0, 8.1AllMinimal source backports only (no official release)
PHP 5.4 – 7.3AllNo fix from PHP project — upgrade required

Confirmed affected environments:

  • Apache mod_php (highest risk)
  • PHP-FPM
  • php-cgi
  • LiteSpeed
  • FrankenPHP

Linux distributions received patches in advance of the public release. Check your distro’s package advisories (Debian, Ubuntu, RHEL, Alpine, etc.) — distribution packages may already have backported fixes.


Scale of Exposure

PHP runs on ~69–70% of all websites where the server-side language is known (W3Techs). That number covers:

  • WordPress (~43% of all websites)
  • Drupal
  • Joomla
  • MediaWiki (Wikipedia’s engine)
  • Laravel
  • Magento

These aren’t niche deployments. This is the base layer of the web. Every one of those platforms running a vulnerable PHP version is exposed, regardless of how secure the application code itself is.

Calif confirmed pre-authentication RCE against specific versions of WordPress, Drupal, and Joomla. The bugs live in the PHP engine — not the apps.


How Exploitation Works

The underlying bugs have existed in PHP’s codebase since PHP 5.4.0 — over a decade. They were found during a cross-industry research effort where frontier AI models were critical in making the exploit chain practical. Wiz described it directly:

“Building the exploit required chaining multiple flaws and adapting to each target’s memory layout through repeated testing and debugging. Frontier models were critical to making this process practical, enabling us to develop and adapt working exploits across multiple applications in hours.”

Multiple public PoC exploits are now available. Current caveats from Rapid7’s analysis:

  • Each PoC demonstrates RCE only against a specific combination of OS, PHP version, and web server
  • None are broadly reliable across targets
  • Exploitation depends on memory layout assumptions unlikely to hold universally on internet-facing instances

That said: Rapid7 also confirmed working exploits under specific lab conditions. The difficulty is not a reason to delay patching — it’s a narrowing window before more portable exploits emerge.

For the mod_php path, exploitation doesn’t require the application to be running. The attack hits before PHP hands control to WordPress or Drupal or anything else. The webserver itself is the attack surface.

For the FPM session path, the attacker needs session upload progress to be enabled (common default configuration) and needs to manipulate request timing across workers.


Red Team Perspective

From an offensive standpoint:

Pre-auth RCE at the engine layer is as good as it gets. If the target runs Apache mod_php on a vulnerable version, you don’t need to interact with the application at all. No login page, no API key, no credentials. Send crafted multipart requests, land RCE, move from the web worker outward.

Memory disclosure matters too. CVE-2026-109619 can leak process memory — which may include session tokens, credentials, API keys, and TLS material from other live connections. On a shared hosting environment or a high-traffic application, that leaked memory could contain data from completely unrelated users or requests.

Fingerprinting PHP version is table stakes. Shodan and similar passive recon tools index PHP version headers where exposed. Many servers leak X-Powered-By: PHP/8.x.x. That’s the triage step that reduces the target list from “everything PHP” to “vulnerable PHP.”

The AI discovery angle is a preview of things to come. Wiz’s writeup is explicit that AI dropped the barrier from “theoretically exploitable complexity” to “working exploits in hours.” Expect this to accelerate in how fast critical bugs go from theory to reliable PoC.


Detection and Defense

Patch Priority

This is an emergency patch. Outside normal patch cycles. If you’re on a vulnerable PHP version:

  1. Check your branch’s fixed version in the table above
  2. Update immediately
  3. Restart all PHP workers after patching (fix only takes effect on restart)
  4. Verify via php --version after update

For PHP 7.4–8.1: use your Linux distribution’s packages or the PHP security team’s minimal source backports. For PHP 5.4–7.3: no fix exists — upgrade to a supported branch.

Detection Signals

Log patterns to watch:

  • Unusual multipart POST requests with extreme content structures
  • Large numbers of failed requests to PHP endpoints (OOM probing)
  • Session upload progress endpoints receiving unexpected traffic
  • PHP worker restarts spiking (OOM kills)
  • Memory allocation failure errors in PHP error logs

Network layer:

  • Outbound connections from web workers to unexpected IPs (post-exploitation indicator)
  • Shell commands in web server logs

Host-based:

  • New processes spawned by the web worker user (www-data, apache, nginx)
  • Unexpected writes under webroot directories

Temporary Hardening (if patching is blocked)

PHP’s own advisory states: no configuration change fully mitigates these vulnerabilities. These are not WAF-bypassable behavior bugs — they’re engine-level memory safety issues.

That said, some partial risk reduction:

  • Restrict internet access to PHP systems that cannot be immediately patched
  • Enforce lower memory_limit and post_max_size (reduces OOM attack surface for CVE-109618, does not eliminate it)
  • Disable session upload progress (session.upload_progress.enabled = 0) — blocks one confirmed attack path for CVE-109619
  • Deploy WAF rules filtering anomalous multipart request patterns (imperfect, not a mitigation)

None of these replace patching.


The AI Discovery Angle

PHP2Shell represents a turning point that security teams should internalize.

These bugs have existed since PHP 5.4.0 — released in 2012. Human researchers were aware that PHP’s memory management had theoretical risk at these boundaries. What changed is that AI made the exploitation chain practical. Wiz’s researchers described chaining multiple flaws, adapting to per-target memory layouts, and iterating through exploit variants — work that historically would take weeks of expert time — compressed into hours with frontier models.

The comparison the Wiz team draws is apt: Heartbleed (2014) showed shared infrastructure fragility. Log4Shell (2021) showed how embedded dependencies created blind spots. PHP2Shell may define a third category: vulnerabilities that were theoretically known but practically unexploitable, where AI eliminates the practical barrier.

Attackers have the same models. The timeline on PHP2Shell — exploitation four days before the patch — reflects that reality. This isn’t a future concern. It’s happening now.


Want to Practice This Safely?

If you want to build a controlled PHP testing environment to practice vulnerability analysis and exploit development:

  • Vultr — $6/month cloud instances; spin up Ubuntu + Apache + vulnerable PHP in minutes, tear down when done
  • DigitalOcean — similar price point; one-click LAMP stacks for fast setup

Test environments should never run on production infrastructure. Isolated VMs with vulnerable software versions, controlled network access, and snapshots before exploitation attempts.


References


Need a Professional Red Team Assessment?

CipherWrite delivers senior-level cybersecurity content and technical writing — from executive threat briefings to detailed vulnerability analysis reports.


Vulnerability status evolves fast. Check vendor advisories for updates as this situation develops.