Skip to content
Sıfırıncı Dakika
Latest

Critical phpAfterShell flaw in PHP: Cloudflare WAF protection is live

Security3 min read
Cloudflare Blog

In brief

depthfirst disclosed phpAfterShell (CVE-2026-126714) on November 19, 2026, a vulnerability in PHP's default file-based session handler that can lead to remote code execution. The critical flaw, rated 9.2 under CVSS 4.0, was fixed the same day in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. Cloudflare updated its WAF rule to block known attack patterns, including for Free plan customers.

  • phpAfterShell (CVE-2026-126714) rated critical at 9.2 under CVSS 4.0
  • Fixed in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0
  • Same releases fix 16 more security flaws, six of them critical
  • Cloudflare WAF rule enabled by default and blocking, including Free plan
  • Three new rules for paid plans cover PHP-FPM and SOAP flaws

What happened

Security research firm depthfirst disclosed a vulnerability called phpAfterShell in PHP's default file-based session handler on November 19, 2026. Tracked as CVE-2026-126714, it scores 9.2 out of 10 under CVSS 4.0 (Critical) and can lead to remote code execution (RCE).

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. Those releases also fix 16 other security vulnerabilities, six of them rated critical.

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 content into the $_SESSION array; when the request ends, it writes the updated session back to the same file. phpAfterShell is triggered when that write is interrupted, leaving the file holding the beginning of the new session data followed by the end of the old one. On the next request, this mixed content is deserialized and PHP can end up loading objects of the attacker's choice.

According to PHP's advisory, an attacker first needs a way to place controlled data in the session. It names two: the "session upload progress" feature, which writes information about a running file upload into the session, and applications that store large user-controlled strings in the session. Code execution also requires an interruption at a useful point in the write and a suitable deserialization gadget chain in the application.

depthfirst reports it reached code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class. The sources reviewed do not establish whether that second bug is fixed in the November 19 releases.

What Cloudflare WAF does

Cloudflare blocks known phpAfterShell attack patterns, including for customers on the Free plan. The company updated the PHP remote code execution rule it first deployed in October 2026 for the php2shell vulnerabilities so that it covers 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.

The same WAF release added three 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). These rules are enabled by default with the Log action, because the request patterns they look for can also appear in legitimate traffic. Customers can review matching requests in Security Events and switch the action to Block once they confirm legitimate traffic is unaffected.

Don't delay the patch

Cloudflare stresses that 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; the only complete fix is to upgrade PHP and restart every worker.

As of November 19, 2026, none of the 17 vulnerabilities was listed in CISA's Known Exploited Vulnerabilities catalog, and no source reviewed reports exploitation in the wild. Cloudflare analysts will keep monitoring attack activity and update the rules as new techniques appear.

Why it matters

PHP powers a large share of the web, and this flaw can lead to direct code execution on the server, so site owners should not delay patching. WAF protection adds a layer but is not a substitute for the fix.

Sources

Related stories