A secure login does not help if an attacker reaches the runtime before the login code executes. PHP2Shell is the name given to two critical PHP core vulnerabilities that can allow unauthenticated remote code execution. PHP released fixes on 21 October 2026.
Two bugs, different failure paths
CVE-2026-109618 concerns corruption during out-of-memory handling. PHP can make an internal data structure visible to cleanup before it is fully initialized. If an allocation fails at that point, longjmp() interrupts normal execution. Cleanup can then treat unfinished memory as valid data. The official advisory confirms remote code execution against Apache mod_php before application code runs.[2]
CVE-2026-109619 concerns stale global state across requests. A fatal error can interrupt an operation after it publishes pointers into request-owned memory but before it resets them. The heap is freed, yet a surviving worker retains those pointers. A later request reaching the same worker can consume the stale state before ordinary initialization clears it. Confirmed paths include session upload progress and, on PHP 8.5, fatal-error backtraces.[1]
Both advisories assign CVSS v4.0 scores of 9.2. That severity does not mean every deployment has the same exploit path or reliability. The runtime build, extensions, frontend behavior, and worker lifecycle matter.[1][2]
PHP-FPM is not a clean bill of health
The researchers traced an affected path back to PHP 5.4.0. PHP's release announcement tells operators to treat all PHP installations serving web requests as at risk, including PHP-FPM, mod_php, php-cgi, FrankenPHP, and LiteSpeed. It identifies mod_php as the highest risk because a demonstrated attack can begin before the application executes.
FPM exits its worker when request startup fails, which breaks some mod_php attack sequences. It does not make FPM immune. The stale-state advisory confirms session lifecycle RCE against FPM when suitable application behavior leaves state behind after successful startup. By contrast, the OOM-corruption advisory does not report a complete FPM exploit for that specific CVE. Keep those two findings separate.[1][2]
The official OOM advisory reports validated exploitation with default PHP input and memory limits and multiple prefork workers. A production pool is not a substitute for a patch.[2]
The first fixed releases
For the supported branches covered by the release, the first fixed versions are PHP 8.2.35, 8.3.36, 8.4.27, and 8.5.12. Update to the fixed release for your branch or a later supported release. PHP 8.1 and older no longer receive normal upstream updates. PHP supplied minimal source backports for 7.4, 8.0, and 8.1 for this incident; distribution and LTS packages need vendor-specific confirmation.
My remediation checklist starts with inventory, not a browser header. Identify the runtime actually serving each application, its package or image source, enabled extensions, deployment owner, and update mechanism. Then apply the upstream or vendor fix, rebuild affected images, redeploy, and restart or replace every worker. Check each pool and replica. A patched CLI binary does not establish that the web worker was replaced.
Temporary controls have limits
PHP explicitly says an update is the only complete solution. If an emergency change is delayed, session.upload_progress.enabled=0 blocks confirmed session paths. On PHP 8.5, fatal_error_backtraces=0 blocks the confirmed backtrace producer. Apply these administratively before request parsing and restart every worker. An ini_set() inside the application, or an FPM .user.ini setting, is too late for the early session path.[1]
For the OOM issue, PHP recommends administratively enforcing memory_limit=-1 as a temporary measure. This removes the predictable PHP memory-limit failure, not every possible allocation failure. It also removes a per-request memory boundary. Do not copy that setting into production without planning availability controls: PHP recommends conservative request limits at the frontend and an appropriate container or cgroup boundary. RLIMIT_AS and RLIMIT_DATA are not replacements; they can trigger the vulnerable allocation-failure path.[2]
A small HTTP body is not automatically safe. Multipart metadata can expand into much larger internal structures, and requests without a usable Content-Length can bypass an initial size check. Enforce limits on decoded body size, multipart parts, headers, input fields, and nesting before PHP receives the request. If the application does not need multipart traffic, block it at that boundary. These controls reduce exposure; they do not repair the runtime.[2]
Detection is evidence, not clearance
PHP's stale-state advisory warns that absence of errors is not proof of safety, and hiding diagnostics does not stop the vulnerable state from being accessed.[1]
For incident triage, I would correlate frontend requests with PHP and web-server errors, worker restarts, unexpected process execution, and outbound traffic. A crash alone does not prove code execution. A quiet log does not prove there was no attempt. Preserve evidence and investigate suspected compromise separately from patch deployment.
What I would verify in an assessment
First, establish patch provenance for the deployed web runtime, including any vendor backport. Then verify worker replacement, effective startup configuration, request limits, and whether an origin remains reachable around the proxy. Exercise legitimate uploads, imports, sessions, and error handling in staging after the change. Destructive memory-exhaustion testing belongs in an isolated, explicitly authorized environment, not as an availability gamble against production.
The practical lesson is straightforward: application security includes the parser and the worker lifecycle below your framework. Patch PHP first. Then verify the running deployment, not just the package installation. A pentest can examine the remaining attack paths, but it should never delay an available critical security update.