PHP2Shell and the patchless window: mitigations are not patches

Two critical PHP remote code execution vulnerabilities were patched on 21 October 2026, but exploitation attempts, constrained public exploit code and a third unresolved vector kept defenders in a prolonged response window. The useful lesson is not that three PHP RCEs remained simultaneously unpatched: it is that runtime inventory, isolation, verified configuration changes and evidence preservation must be rehearsed before the next emergency.

Macsta Threat Intelligence

What happened

The claim under test was that PHP faced three unpatched RCEs in three days. The primary record supports a more complicated and more operationally useful account.

On 20 October, PHP gave advance notice of two critical vulnerabilities and scheduled an emergency release. Fixes for CVE-2026-109618 and CVE-2026-109619 arrived on 21 October in PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Linux distributions and long-term-support vendors had received the patches in advance, while minimal source backports were supplied for PHP 7.4, 8.0 and 8.1. (src: PHP advisory, CERT-EU)

Cloudflare enabled its managed PHP2Shell protections by default shortly before that release. It subsequently reported attack traffic and payload changes intended to evade its rules. watchTowr separately reported exploitation attempts against both original vulnerabilities through its honeypot network. These observations establish hostile activity, not successful compromise of every scanned system. (src: Cloudflare, watchTowr)

On 22 October, Exploit-DB published a full-chain implementation for CVE-2026-109618. Its documented requirements include particular PHP 8.4.26 and Apache prefork profiles, a single worker, specific settings and build-dependent offsets. It proves that working public exploit code exists; it does not establish reliable exploitation against arbitrary PHP deployments. (src: Exploit-DB 52704)

PHP disclosed CVE-2026-115560 on 23 October. This narrower vector affects even the releases patched two days earlier, but requires an unusual combination of configuration and application behaviour. PHP therefore recommended disabling session upload progress until its next regular bugfix release rather than issuing another emergency release. As of 27 October, the project archive still listed the full advisory and fix as forthcoming. (src: PHP advisory)

CISA added both original vulnerabilities to its Known Exploited Vulnerabilities catalogue on 26 October. Its guidance includes taking PHP-based systems offline where organisations cannot update them, including systems running unsupported versions. (src: CISA)

How it works

CVE-2026-109618 begins with interrupted initialisation after memory exhaustion. PHP historically used longjmp() to abort processing following an out-of-memory condition. If allocation fails while request memory is only partly initialised, cleanup can treat invalid state as valid and attempt to free memory that was never properly established.

Attackers can drive exhaustion through multipart parsing behaviours, including requests without a usable declared content length, large numbers of multipart headers and nested field names. The allocation that fails need not belong directly to the structure later corrupted. The fix delays the soft out-of-memory exit until a virtual-machine safe point and uses a higher hard limit that terminates immediately. Complete unauthenticated RCE was demonstrated over HTTP against default Apache mod_php configurations. Source analysis supports FPM susceptibility after normal request startup, but PHP did not demonstrate a complete FPM exploit for this vulnerability. (src: PHP GHSA-w8hw-w9fx-j79w)

CVE-2026-109619 crosses request boundaries. Persistent workers can retain global fields pointing into memory owned by one request. Fatal errors, timeouts or late diagnostics may prevent the corresponding reset. After that request heap is freed, a subsequent request on the same worker can consume the stale pointer before ordinary initialisation replaces it, producing a use-after-free.

Exploitation consequently needs a producer that leaves request-owned state globally reachable and a consumer that accesses it during a later request. Confirmed consumers include early INI diagnostics and session upload-progress processing. Upload progress is enabled by default and can reach session handling without the application calling session_start(). RCE was validated against mod_php; a session lifecycle path was also validated against FPM, although that chain required a suitable application operation. (src: PHP GHSA-6wmf-4rv5-p3rp)

Wiz demonstrated pre-authentication RCE against representative WordPress, Drupal and Joomla deployments, as well as disclosure of live worker memory that could contain credentials, tokens or keys. Those applications were demonstration targets, not prerequisites: the defects reside in the PHP runtime. (src: Wiz Research)

CVE-2026-115560 should not yet be folded into either root-cause description. PHP has disclosed four required conditions: the initial session.serialize_handler must be php_binary or php_serialize; application code must change it to php using ini_set(); that change must occur before session_start(); and session upload progress must remain enabled. Applications that never change the serialiser at runtime are not exposed through this path. PHP has not published enough analysis to justify calling it another use-after-free or a confirmed incomplete patch for CVE-2026-109619. (src: PHP advisory)

Why it matters

This is a runtime problem, not a CMS patching exercise. PHP places installations serving web requests across FPM, mod_php, php-cgi, FrankenPHP and LiteSpeed in scope, with mod_php at highest risk. Updating WordPress or another application does not update the interpreter beneath it. Successful RCE inherits the PHP worker's privileges, so impact depends on that identity's access to application data, secrets, files, databases and network services. (src: PHP advisory, Wiz Research)

The patchless window also has several forms. It includes the interval between advance notification and release, the rollout delay while packages and maintenance windows are arranged, the continuing exposure of unsupported branches, and the narrower residual risk left by CVE-2026-115560. A single “patched” or “unpatched” dashboard field cannot represent those states accurately.

Distribution backports create another verification trap. A vendor package may contain the fix without carrying one of the upstream fixed version numbers. Conversely, an upstream-looking version string does not prove that running workers have loaded the new code. Package changelogs, vendor advisories and worker restarts therefore matter as much as version comparison. (src: CERT-EU)

WAF coverage is valuable but incomplete. Cloudflare describes its rules as mitigations rather than substitutes for patching. Its rule for CVE-2026-115560 covers the default upload-progress field name, but not sites that changed session.upload_progress.name. It also uses response signals because request data alone cannot always distinguish an exploit reliably. A generic rule should not be treated as proof of protection. (src: Cloudflare)

What to do about it

Start with a queryable inventory of the actual web runtime. Record ownership, SAPI, internet exposure, vendor support status and PHP embedded in appliances, control panels, containers and vendor products. Install the fixed runtime or vendor backport, then restart every relevant PHP worker and web service. Isolate systems that cannot be fixed; CISA recommends taking unpatchable or unsupported PHP systems offline until they can be updated. (src: CISA)

While patching CVE-2026-109618, PHP's interim controls include enforcing memory_limit=-1 administratively and verifying that pools, directories or applications cannot restore a finite limit. Keep post_max_size conservative and upload_max_filesize below it. Enforce decoded body, field, multipart-part, header and nesting limits at the proxy or web server, including for requests without usable Content-Length. Do not substitute RLIMIT_AS or RLIMIT_DATA, which can trigger the vulnerable allocation-failure path. Container or cgroup limits should be treated as availability boundaries, preferably isolating failure to one worker. (src: PHP advisory)

For CVE-2026-109619, set session.upload_progress.enabled=0 in startup or server configuration and restart all workers. Do not rely on ini_set() or .user.ini. On PHP 8.5, also set fatal_error_backtraces=0. Remove attacker-reachable fatal errors, timeouts and early configuration diagnostics where possible; hiding their display or logging does not remove the underlying condition. The same upload-progress change, if retained, fully protects against the specific CVE-2026-115560 vector according to PHP. Other interim measures remain partial mitigations. (src: PHP advisory)

Preserve web, PHP and process telemetry before emergency remediation overwrites evidence. Investigation signals include unusual multipart requests followed by memory-limit errors or repeated HTTP 500 responses, unexpectedly large PHPSESSID response cookies, unexplained worker churn, and PHP workers spawning shells or downloading tools. Patching does not establish that a previously exposed host was uncompromised. (src: Wiz Research, CISA)

Finally, turn the response into a standing playbook. Pre-approve isolation, configuration deployment and restart procedures. Test that emergency settings reach the web runtime rather than only CLI PHP. Document WAF blind spots and test custom field names and multipart handling. Assign owners and expiry dates to temporary controls. Exit only when the vendor fix is deployed, the effective version is verified, workers are restarted, temporary measures are reviewed and compromise assessment is complete.

Sources