OFFSEC · Offensive Security

PHP2Shell: the runtime is the patch target, and a version bump is not the end of it

Two critical PHP core flaws leaked a day early and were fixed on 21 October. Updating the application does nothing, the fix is not live until every worker restarts, and the hosts most at risk are the ones no upstream patch covers.

The PHP security release of 21 October fixes two flaws in the runtime that sits under most of the web. The work does not end at the package manager. A host is fixed only when the patched binary is the one serving requests, and a host exposed before that point may already have leaked its secrets.

What was fixed, and how it came out early

PHP shipped 8.5.12, 8.4.27, 8.3.36 and 8.2.35 at 14:00 UTC on 21 October, 22:00 in Kuala Lumpur, fixing two critical bugs that it rates CVSS v4.0 9.2 [1]. CVE-2026-109618 is described as remote code execution through out-of-memory corruption: an out-of-memory exit leaves request memory partly initialised, and multipart request parsing is among the triggers [2]. CVE-2026-109619 is described as remote code execution through stale global state, a use-after-free in which a persistent worker keeps a pointer into freed request memory that a later request on the same worker can reach [3]. Neither requires authentication [2][3].

The release was brought forward a day. The PHP Foundation’s timeline records the CVE identifiers leaking at about 15:00 UTC on 20 October with an incorrect score of 10.0, a researcher’s proof-of-concept video being posted at about 20:00 UTC, and a container vendor publishing patched images at 07:41 UTC on 21 October, which the Foundation describes as breaking the embargo [4]. The Foundation calls the time taken to ship a fix after the first reports on 11 August “a structural failure” [4]. The reporters credited across the advisories and the researchers’ site are Wiz Research, Calif and OpenAI Codex Security [2][8].

Within hours, governments and companies took services offline as a precaution. In the Netherlands these included DigiD, MijnOverheid, the parliament’s site and the national CSIRT’s own site, and the Dutch NCSC said any internet-reachable system containing PHP was presumed vulnerable until updated [16]. Reporting from the region records a critical alert from the Australian Cyber Security Centre and an alert from Singapore’s Cyber Security Agency [17].

Why application patching misses it

The attack surface is the runtime’s request handling. On Apache mod_php, watchTowr notes, a request can succeed before any application code runs [5]. Cloudflare’s guidance is explicit that updating application code or plugins alone does not fix the issue [7]. Researchers report pre-authentication code execution on current container images of WordPress, Drupal and Joomla [8], and Sansec reports the same on Magento 2.4.9 and ten other PHP applications [10]. Datadog reproduced CVE-2026-109618 with a single unauthenticated POST and notes that any PHP script exposing the path is affected, even one that only prints a response [12].

Three operational traps follow. First, long-running workers keep the old code. The researchers’ site and Canonical both say Apache, PHP-FPM and other long-running workers must be restarted after upgrading, and Canonical notes that unattended upgrades do not restart applications [8][9]. Second, distribution version strings mislead. Ubuntu 24.04’s fixed package is 8.3.6-0ubuntu0.24.04.13, and 20.04 and older need extended security maintenance [9]; a scanner keyed to upstream version numbers will misreport both ways. Third, the fix changes behaviour: a new hard memory limit now terminates a process that reaches it, so memory_limit and post_max_size need review before a rollout breaks uploads [14].

The long tail is the exposure

Upstream fixes cover 8.2 to 8.5. PHP published minimal source backports for 7.4, 8.0 and 8.1, and distributions received patches in advance [1]. Anything older depends on a vendor. A Shodan-based count published by CybelAngel found about 2.24 million internet-facing hosts advertising PHP, of which 883,717 of roughly 1.5 million versioned hosts ran unpatched branches, with about 740,000 hiding their version [15]. SOCRadar gives about 884,000 [18]. The same dataset shows 82 per cent of versioned PHP hosts in South Korea and 75 per cent in China on unpatchable branches [15]. Huntress points defenders at PHP bundled inside vendor appliances, Windows software and hosting control panels, which rarely appear in a web-server inventory [11].

Where the sources disagree

  • Severity. PHP scores both flaws 9.2 and the Foundation calls the leaked 10.0 incorrect [1][4]. watchTowr’s advisory listed CVE-2026-109619 as not yet scored [5].
  • Affected range. Cloudflare, the researchers’ site and Sansec say PHP 5.4 or later [7][8][10]; watchTowr’s FAQ says PHP 5, 7 and 8 in entirety while noting the scope was unconfirmed [6]. PHP’s advisories list only supported branches [2][3].
  • Exploitation. Cloudflare reported early attacks and payloads mutating to evade its rules [7][14]. watchTowr reported active exploitation attempts from 14:19 UTC on 21 October [14][5]. Huntress had seen none in its partner base that morning, US Eastern time [11], the Dutch NCSC had seen none [16], and the Foundation knew of no working exploits at release [4]. Neither CVE was in the US known-exploited catalogue when these sources were written [6][18].
  • The upload-progress setting. PHP lists disabling session upload progress as a partial mitigation [1][3]. watchTowr calls ini changes ineffective [5], and Datadog says the setting does not protect you [12].
  • FPM. PHP’s advisory for CVE-2026-109618 says no complete FPM exploit was demonstrated [2]; the Foundation says RCE was later confirmed on FPM through application code paths [4], and the advisory for CVE-2026-109619 records RCE validated on FPM [3].
  • Exposure counts measure different things: 2.24 million hosts advertising PHP [15], more than 1.3 million potentially vulnerable and more than 1.9 million PHP hosts on Shodan in two researchers’ counts [13], and about 884,000 on unpatched branches [18].

What to do

  • Inventory the runtime, not the application: every PHP binary, including copies inside appliances, control panels and packaged Windows software [11].
  • Verify fixes by changelog and CVE identifier, not by version string, on distribution builds [9].
  • Restart every Apache, PHP-FPM and long-running worker after updating, and confirm the running binary [8][9].
  • Preserve logs and configuration before changing anything, then hunt for web shells, new cron entries and new accounts [5].
  • Alert on PHP or web-server processes spawning shells, interpreters or download tools, as Huntress recommends [11]. Watch for unusual multipart requests followed by memory-limit errors or repeated HTTP 500s, and for unexplained worker restarts [14][12].
  • Rotate credentials, tokens and keys on any host that was exposed between the leak and its patch. Researchers state one flaw can disclose worker memory without code execution [8].
  • Where a host cannot be patched, restrict access to it or take it offline. If an application does not use multipart uploads, blocking them at the front end is a stopgap PHP and Sansec both describe, with the uploads it breaks [2][10]. Tenable warns that public exploit code may itself contain malware [13].

The offensive security read

This is a pre-application, pre-authentication primitive in a runtime with a fourteen-year tail of affected releases. The leak compressed the defenders’ window to under a day, and Help Net Security reports Wiz’s view that frontier models lowered the cost of turning the flaws into working exploits [19]. The organisations that come out of it cleanly will be the ones that already knew where their PHP binaries were and could prove a restart. The rest are patching a dashboard.

Sources

Every R3KONX article cites its primary material. 19 sources, in order of first citation. Links open the original publication.

  1. PHP news archive 2026: security release advance notice and PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 released The PHP Group · 2026-10-21
  2. RCE via OOM corruption (GHSA-w8hw-w9fx-j79w, CVE-2026-109618) PHP, GitHub security advisory · 2026-10-21
  3. RCE via stale global state (GHSA-6wmf-4rv5-p3rp, CVE-2026-109619) PHP, GitHub security advisory · 2026-10-21
  4. Today's PHP security release and how we're strengthening PHP security The PHP Foundation · 2026-10-21
  5. PHP2Shell: CVE-2026-109618 & CVE-2026-109619 watchTowr · 2026-10-21
  6. PHP2Shell: CVE-2026-109618 & CVE-2026-109619 (FAQ) watchTowr · 2026-10-20
  7. PHP vulnerabilities and WAF protection Cloudflare · 2026-10-21
  8. PHP2Shell Wiz Research, Calif and OpenAI Codex Security (php2shell.com) · 2026-10-21
  9. php2shell (CVE-2026-109618 and CVE-2026-109619) vulnerability fixes available Canonical · 2026-10-21
  10. PHP2Shell: Critical PHP RCE (CVE-2026-109618, CVE-2026-109619) Sansec · 2026-10-21
  11. Rapid Response: php2shell, Leaked Critical PHP Vulnerabilities Huntress · 2026-10-21
  12. PHP2Shell – Critical vulnerabilities in PHP: detection, analysis, and remediation Datadog Security Labs · 2026-10-21
  13. php2shell (CVE-2026-109618, CVE-2026-109619): Frequently Asked Questions Tenable · 2026-10-21
  14. PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts Emerge The Hacker News · 2026-10-21
  15. What We Know About php2shell CybelAngel · 2026-10-21
  16. Websites van overheid en in onderwijs offline vanwege lek, risico op hacks NOS · 2026-10-21
  17. Critical global website flaw sparks alerts across Asia-Pac as attacks begin Insurance Business Asia · 2026-10-21
  18. PHP2Shell: CVE-2026-109618 & CVE-2026-109619 SOCRadar · 2026-10-21
  19. PHP2Shell: Critical PHP vulnerabilities patched, update now! Help Net Security · 2026-10-21

Researched and written by the R3KONX analysis desk from the cited primary material. Exploitation status was changing during the 24 hours covered; reports of attempted exploitation are reported as attempts, not confirmed compromises. Exposure figures come from different scanning methods and are not comparable with one another. The national alerts from the UK, Singapore, Australia and CERT-EU are described from secondary reporting because the alerts themselves could not be retrieved. Corrections to event@r3konx.asia.

R3KONX 2027

Work in this domain? So does the programme

4–6 May 2027, World Trade Centre Kuala Lumpur. Curated talks, hands-on training and The BattleGrid.