· via Cloudflare blog
phpAfterShell: PHP patches critical 9.2-rated RCE in default session handler
PHP shipped same-day fixes for phpAfterShell, a critical flaw in its default file-based session handler that permits remote code execution, alongside patches for six more critical vulnerabilities.

What happened
On November 19, 2026, security research company depthfirst disclosed phpAfterShell, a vulnerability in PHP's default file-based session handler that can lead to remote code execution. Tracked as CVE-2026-126714, it scores 9.2 out of 10 — Critical — under CVSS 4.0, according to the Cloudflare blog. The PHP project shipped fixes the same day in versions 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. Those releases also close 16 other security vulnerabilities, six of them likewise rated critical.
The CVE record credits Leo Lin and Asahi as reporters, while depthfirst says it discovered and reported the flaw. As of the disclosure date, Cloudflare found no evidence of exploitation in the wild, and none of the 17 vulnerabilities appeared in CISA's Known Exploited Vulnerabilities catalog.
How the flaw works
PHP stores session data in files by default. When an application calls session_start(), PHP reads the session file and deserializes its contents into the $_SESSION array; when the request ends, it writes the updated session back to the same file.
According to Cloudflare's write-up, phpAfterShell is triggered when that write is interrupted. The session file can then hold the beginning of the new session data followed by the end of the old one. On the next request, session_start() deserializes this mixed content, and if the attacker controlled the old data, PHP can end up deserializing objects of the attacker's choice.
PHP's advisory names two ways an attacker could plant controlled data: session upload progress, a feature that writes information about a running file upload into the session and can be shaped by a remote client, and applications that store large user-controlled strings in the session. Code execution further requires an interruption at a useful point in the write plus a suitable deserialization gadget chain. depthfirst says it reached code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class; Cloudflare notes that the sources it reviewed do not establish whether that second bug is fixed in the November 19 releases.
Six more critical fixes
Each of the other six critical vulnerabilities needs specific conditions to be exploitable:
- CVE-2026-129289 lets an unauthenticated attacker smuggle a second FastCGI request into PHP-FPM and run PHP code as the worker. It requires a front end that reuses backend FastCGI connections — nginx with fastcgi_keep_conn on, Apache mod_proxy_fcgi with enablereuse=on, or HAProxy — plus an application path that opens php://input without reading it to the end.
- CVE-2026-115560 is object injection through a mismatch between session serializers, affecting applications, pools or command-line jobs that use different serializers and share a session store.
- CVE-2026-129496 is a use-after-free in the timezone cache that can crash a fresh worker and possibly run code.
- CVE-2026-129481, CVE-2026-129474 and CVE-2026-129182 are use-after-free bugs tied to session shutdown and fatal error backtraces, mostly in PHP 8.3 and later.
WAF coverage
Cloudflare's WAF blocks known phpAfterShell attack patterns on every plan, including Free. The underlying rule was first deployed on October 21, 2026, after the php2shell disclosures (CVE-2026-109618 and CVE-2026-109619), extended to CVE-2026-115560 on October 23, and updated on November 19 to cover phpAfterShell. Because phpAfterShell shares php2shell's technique of planting serialized data in session storage, the rule already matched part of the pattern before disclosure.
Three additional rules, covering CVE-2026-129289 and two SOAP extension flaws (CVE-2026-15353 and CVE-2026-129506), were added to the paid Managed Ruleset with a default Log action, since the patterns they look for can also appear in legitimate traffic. Cloudflare stresses that its WAF is an extra layer, not a substitute: the only complete fix is upgrading PHP and restarting every worker.
Who needs to patch
Vulnerable versions are PHP 8.2 before 8.2.36, 8.3 before 8.3.37, 8.4 before 8.4.28, 8.5 before 8.5.13, and the 8.6.0 release candidates. PHP 8.1 and earlier are end-of-life. The sources disagree on older branches: depthfirst says the official 7.4, 8.0 and 8.1 mitigation branches are unaffected by phpAfterShell, but PHP says CVE-2026-129289 dates back to PHP 5.6.0 and releases older than 8.2 may also be exposed to CVE-2026-115560. Linux distributions often backport fixes without changing the version number, so operators should compare the full package version against their distribution's advisory.
Why it matters
A remote-code-execution flaw in PHP's default session handler is not a niche bug: any application using PHP's stock session handling is a potential target, and PHP runs a large share of the web, often buried inside content management systems, plugins and container images that teams do not update directly. With seven critical vulnerabilities fixed in a single round of releases, and the complete remedy being an upgrade plus a restart of every worker, this is an urgent patching item rather than routine maintenance — and WAF rules, however useful, only buy time while that work happens.
- #php
- #security
- #vulnerability
- #cloudflare
- #patch-management