php2shell: Two Unauthenticated PHP RCEs, One Image Rebuild per Service

You cannot fix this one from your application repository. The two flaws PHP disclosed yesterday sit in the interpreter, and the first was demonstrated over HTTP before any application code runs. The fix is a new runtime in every image and on every host, which makes today's real question an inventory question: where is all your PHP?
| At a glance | |
|---|---|
| Identifiers | CVE-2026-109618, RCE via OOM corruption, and CVE-2026-109619, RCE via stale global state |
| Affected | PHP before 8.2.35, 8.3.36, 8.4.27 and 8.5.12, per PHP. PHP's announcement and CISA say all PHP installations serving web requests. UK NCSC says all versions may be affected. |
| Fixed in | 8.2.35, 8.3.36, 8.4.27, 8.5.12 |
| Severity | Critical, CVSS 4.0 base 9.2 for both, scored by the PHP project as CNA |
| Exploited as of 2026-10-22 | Attempts and early attacks reported. No confirmed compromise in these sources. Not in CISA KEV. |
| Disclosed | 21 October 2026. php.net's changelog dates all four fixed releases 22 October. |
The bug is in how PHP gives up
PHP handles out-of-memory errors with longjmp(): it jumps out of the current context and aborts the request. In some contexts, request memory is reachable before it is fully initialised. If an allocation fails there, request shutdown then reads or branches on invalid state.
So the attacker's job is to exhaust memory at the right moment, and the advisory lists ways that need no application help. A multipart request without a usable declared content length can pass the initial post_max_size check. A part can carry unlimited headers that cost far more inside PHP than on the wire.
CVE-2026-109619 is the same family with a longer fuse. Persistent worker globals keep pointers to request memory after it is freed, because a fatal error, OOM included, can abandon an operation before its matching reset. A later request on the same worker then reads or frees the stale value. PHP confirms two consumers: INI diagnostics raised before request initialisation, and session upload progress handling.
The CVE-2026-109618 patch removes longjmp() for OOM. PHP now takes a soft OOM at the next VM safe point and calls _exit() at a second, higher threshold, so shutdown never sees invalid state. The CVE-2026-109619 patch resets the wider request-owned state so it cannot survive into operations that run before the next request initialises.
Your SAPI sets the order, not the exemption
| SAPI | CVE-2026-109618, per PHP's advisory | CVE-2026-109619, per PHP's advisory |
|---|---|---|
| Apache mod_php | Shutdown runs even when startup fails. RCE validated over HTTP with default input and memory limits. | RCE confirmed through the PHP 8.5 fatal backtrace path and validated through the session lifecycle path. |
| PHP-FPM | The child exits when startup fails. Source analysis suggests it stays susceptible after normal startup. No complete exploit demonstrated. | Session lifecycle RCE validated, depending on a suitable application operation. Conditionally exposed when the frontend sends PHP_VALUE or PHP_ADMIN_VALUE parameters that produce a diagnostic before request initialisation. |
| FrankenPHP | Source analysis says likely susceptible to application-independent attacks. | No equivalent early configuration consumer established in the default configuration, which PHP says does not make it immune. |
| LSAPI | Modelled on FPM. Application-specific exploits likely but unvalidated. | Can apply special environment INI values early, which makes it a conditional candidate. |
BleepingComputer quotes PHP: "We consider the risk highest for mod_php." Use the table to order your queue, not to skip anyone. Exploit portability depends on build, extensions, frontend behaviour and allocator layout, which is friction for an attacker, not a boundary for you.
What is reported so far
Amazon says its MadPot honeypot logged an attempt on 17 October, four days before disclosure, and that proofs of concept appeared from about 02:00 UTC on 21 October, ahead of the 14:00 UTC embargo lift. Cloudflare CTO Dane Knecht said the company saw early attacks before the patches shipped, per BleepingComputer. Help Net Security reports a working exploit triggered by a single unauthenticated request.
Honeypot attempts are not compromises, and PHP vouches only for its own demonstrations: mod_php for CVE-2026-109618, mod_php and PHP-FPM for CVE-2026-109619. The missing KEV entry is still no reason to wait.
What to do now
- Upgrade. Move to 8.2.35, 8.3.36, 8.4.27 or 8.5.12, or later in the same branch, then rebuild and redeploy everything carrying the runtime. Amazon and PHP both say updating is the only complete fix.
- On distribution packages, read the vendor's advisory. Help Net Security reports that Linux distributions and LTS vendors received patches before public release. Confirm the fix for the package you run.
- On 8.1 or older, treat yourself as affected. PHP's advisories list only 8.2 onward and those branches get no upstream updates, but minimal source backports exist for 7.4, 8.0 and 8.1, which tells you enough. NCSC says to consider taking offline what you cannot patch or mitigate.
- If you cannot patch today, reduce exposure, and know it is partial. WAF rules from AWS and Cloudflare are defence in depth, not a fix.
- For CVE-2026-109618, set and enforce
memory_limit=-1administratively, restart every worker, and confirm that no pool, directory or application setting restores a finite limit. PHP says a cgroupmemory.maxlimit can stand in for PHP's own, with caveats: it does not guarantee against allocation failure, and a kill can take the master and every worker unless each worker has its own group. AvoidRLIMIT_ASandRLIMIT_DATA, which makemmap()fail at the limit and reach the vulnerable path. Keeppost_max_sizeconservative, and block multipart at the frontend if you do not use it. - For CVE-2026-109619, set
session.upload_progress.enabled=0and, on 8.5,fatal_error_backtraces=0administratively, then restart every worker. PHP: "There is no complete generic configuration mitigation."
- For CVE-2026-109618, set and enforce
- Hunt from 17 October, not from disclosure. Amazon suggests looking for POST requests containing
PHP_SESSION_UPLOAD_PROGRESSin form uploads, and for unexpected process execution or file changes on web servers. Code runs as the web worker account, so if you find signs, treat whatever that account can read as exposed.
The inventory is the incident
A library bug gets a dependency bump. An interpreter bug gets a new runtime under every service. Code scanning and application reachability analysis have little to say about the mod_php path, which runs before your code does, and even on FPM, where an application operation can matter, the fix is still the runtime. What decides priority is the runtime version, the SAPI and the deployment, all of which live in the artifact you ship. Often that PHP arrived through a base image, not a decision anyone remembers.
So do not start from a list of "our PHP services". Start from what is running: deployed images, then hosts, then software you bought. NCSC calls out PHP embedded in other software and appliances, and tells organisations to keep monitoring third-party vendors for updates to appliances and services that may bundle it.
Discovering what you ship from source control, registries and cloud accounts, scanning it, and keeping one findings list with EPSS and KEV signals beside it is the problem we work on at Dwaar.
Take your largest registry or cloud account and answer three questions for every running image: which PHP version, which SAPI, and is it reachable from the internet? Internet-facing mod_php goes first. If building that list takes longer than the patch, you have found your next project.
References
- GHSA-w8hw-w9fx-j79w, RCE via OOM corruption, PHP project, 21 October 2026
- GHSA-6wmf-4rv5-p3rp, RCE via stale global state, PHP project, 21 October 2026
- CVE-2026-109618 announcement, oss-security, 21 October 2026
- CVE-2026-109619 announcement, oss-security, 21 October 2026
- Security advisory: Critical remote code execution vulnerabilities, update now, PHP project, 21 October 2026
- PHP 8 ChangeLog, PHP project, 22 October 2026
- CVE-2026-109618, NVD, 21 October 2026
- CVE-2026-109619, NVD, 21 October 2026
- Critical Vulnerabilities in PHP Require Immediate Patching, CISA, 21 October 2026
- Critical security issue affecting PHP, UK NCSC, 21 October 2026
- Amazon Threat Intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot, AWS Security Blog, 21 October 2026
- PHP ships emergency patches for critical PHP2Shell flaws, BleepingComputer, 21 October 2026
- php2shell PHP vulnerabilities patched, Help Net Security, 21 October 2026, updated 22 October 2026
