How Cloudflare WAF helps protect against phpAfterShell and other critical PHP flaws
Captured source
source ↗How Cloudflare WAF helps protect against phpAfterShell and other critical PHP flaws | Cloudflare Blog
Skip to content
On November 19, 2026, the security research company depthfirst disclosed phpAfterShell (CVE-2026-126714) , a vulnerability in PHP's default file-based session handler that can lead to remote code execution. Under the Common Vulnerability Scoring System (CVSS) 4.0, it scores 9.2 out of 10 (Critical). The PHP project fixed it the same day in versions 8.2.36, 8.3.37, 8.4.28, 8.5.13, and 8.6.0. These releases fix 16 other security vulnerabilities, six of them also rated critical. Cloudflare’s web application firewall (WAF) blocks known phpAfterShell attack patterns, including for customers on the Free plan. The protection comes from a PHP remote code execution rule we first deployed in October 2026 for the php2shell vulnerabilities. That rule already detected part of the phpAfterShell attack pattern before the vulnerability was disclosed, and on November 19 we updated its detection logic to cover phpAfterShell. The rule is part of both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset, is enabled by default, and its default action is Block. In the same WAF release, we added three new rules to the Cloudflare Managed Ruleset for paid plans: one for a request smuggling flaw in PHP-FPM (CVE-2026-129289), and two for flaws in PHP's SOAP extension (CVE-2026-15353 and CVE-2026-129506) that PHP fixed in the same releases. These rules are enabled by default with the Log action, because the request patterns they look for can also appear in legitimate traffic, and blocking by default could disrupt it. Customers can review matching requests in Security Events now and change the action to Block once they confirm the rules do not affect legitimate traffic. The WAF is an additional layer of defense, not a replacement for the patch. Several of the critical flaws depend on server configuration or can be reached through paths a WAF does not see, and the only complete fix is to upgrade PHP and restart every worker. Our analysts continue to monitor attack activity and will update the rules as new techniques and variations appear. You can track rule changes in the WAF changelog and follow how the vulnerabilities develop in the dedicated Cloudflare Zero Wire briefing . There appears to be no indication so far that these vulnerabilities have been exploited. As of November 19, 2026, none of the 17 vulnerabilities was listed in CISA's Known Exploited Vulnerabilities catalog , and no source we reviewed reports exploitation in the wild. What we know about phpAfterShell PHP stores session data in files by default. When an application calls session_start(), PHP reads the session file and deserializes its content into the $_SESSION array. When the request ends, PHP writes the updated session back to the same file. 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. If an attacker controlled the old data, PHP can end up deserializing objects of the attacker's choice. An attacker trying to exploit the flaw is likely to first search for a way to place controlled data in the session. PHP's advisory names two: Session upload progress , a PHP feature that writes information about a running file upload into the session. A remote client can use it to shape the stored data. Applications that store large user-controlled strings in the session .
According to PHP, code execution also requires an interruption at a useful point in the write and a suitable deserialization gadget chain in the application. depthfirst reports that it reached code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class. The sources we reviewed do not establish whether that second bug is fixed in the November 19 releases. depthfirst says it discovered and reported phpAfterShell. The CVE record credits Leo Lin and Asahi as reporters. The other critical flaws The same releases fix six more critical vulnerabilities. Each one needs a specific configuration to be exploitable: CVE Component Impact Conditions
CVE-2026-129289 PHP-FPM An unauthenticated attacker can smuggle a second FastCGI request into PHP-FPM and run PHP code as the worker. A front end that reuses backend FastCGI connections (nginx with fastcgi_keep_conn on, Apache mod_proxy_fcgi with enablereuse=on, or HAProxy), an application path that opens php://input without reading it to the end, and the path of an existing PHP script.
CVE-2026-115560 Session serializer Object injection through a mismatch between session serializers. First covered in our php2shell briefing, now fixed. Session upload progress enabled. PHP widened the scope: applications, pools or command-line jobs that use different serializers and share a session store are affected.
CVE-2026-129496 Timezone cache Use-after-free that can crash a fresh worker and possibly run code. PHP demonstrated code execution locally with known memory addresses. Non-thread-safe builds where a startup diagnostic has been written to a PHP error log file.
CVE-2026-129481 Session shutdown Use-after-free, described by PHP as an incomplete fix for CVE-2026-109619. No code execution demonstrated. PHP 8.3 and later.
CVE-2026-129474 Fatal error backtraces Use-after-free in magic method backtraces. PHP 8.5 and later, where fatal error backtraces are enabled by default. Setting zend.exception_ignore_args=1, the php.ini-production default, blocks the demonstrated attack.
CVE-2026-129182 Fatal error backtraces Use-after-free. No code execution demonstrated. PHP 8.5, specific path-level settings, and an Apache per-directory configuration or front end that produces an early diagnostic.
Who is affected The 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. Whether a deployment is exposed depends on the conditions of each flaw. PHP 8.1 and earlier are end-of-life. depthfirst says the official 7.4, 8.0 and 8.1 end-of-life mitigation branches are not affected by phpAfterShell, but PHP says CVE-2026-129289 was introduced in PHP 5.6.0 and that releases older than 8.2 may also be affected by CVE-2026-115560. Linux distributions often backport fixes without changing the PHP version number....
Excerpt shown — open the source for the full document.
Notability
notability 5.0/10Vendor security blog, moderately substantive.