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 (Cloudflare). The flaw scores 9.2 out of 10 (Critical) under CVSS 4.0 (Cloudflare). PHP fixed it the same day in versions 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0 (Cloudflare).
The company confirmed that its WAF blocks known phpAfterShell attack patterns, including for customers on the Free plan (Cloudflare).
Key Facts
| Item | Detail | Source |
|---|---|---|
| Flaw | phpAfterShell, CVE-2026-126714, in PHP’s file-based session handler | Cloudflare |
| Severity | 9.2 out of 10 (Critical) under CVSS 4.0 | Cloudflare |
| Fixed in | PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0 | Cloudflare |
| Other fixes | 16 other security vulnerabilities, six of them also rated critical | Cloudflare |
| Exploitation | None of the 17 listed in CISA’s Known Exploited Vulnerabilities catalog as of November 19, 2026 | Cloudflare |
Timeline
- 2026-10-21: Cloudflare released its original PHP remote code execution rules in an emergency release (Cloudflare).
- 2026-11-19: depthfirst disclosed phpAfterShell, PHP issued the fixes, and Cloudflare updated its rule’s detection logic to cover the flaw (Cloudflare).
- 2026-11-20: Cloudflare published its blog post on WAF protection against phpAfterShell and the other critical PHP flaws (Cloudflare).
Details (as Reported)
PHP stores session data in files by default, and session_start() deserializes the file’s content into the $_SESSION array (Cloudflare). The flaw is triggered when the write at the end of a request is interrupted, leaving the beginning of the new session data followed by the end of the old one (Cloudflare). PHP’s advisory names two ways to place controlled data in the session: session upload progress, and applications that store large user-controlled strings in the session (Cloudflare). Code execution also depends on an interruption at a useful point in the write and a suitable deserialization gadget chain in the application, according to PHP (Cloudflare).
The WAF protection comes from a PHP remote code execution rule first deployed in October 2026 for the php2shell vulnerabilities (Cloudflare). 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 (Cloudflare). The company also added three rules to the Cloudflare Managed Ruleset for paid plans, covering CVE-2026-129289 in PHP-FPM and CVE-2026-15353 and CVE-2026-129506 in PHP’s SOAP extension (Cloudflare). They default to the Log action because the request patterns can also appear in legitimate traffic (Cloudflare).
Cloudflare described the WAF as an additional layer of defense rather than a replacement for the patch, and noted that the only complete fix is to upgrade PHP and restart every worker (Cloudflare). 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 (Cloudflare). Linux distributions often backport fixes without changing the PHP version number, so the full package version should be checked against the distribution’s advisory (Cloudflare).
Each of the other six critical flaws needs a specific configuration to be exploitable (Cloudflare). Leo Lin and Asahi are credited as reporters in the CVE record (Cloudflare).
What Is Not Yet Confirmed
- depthfirst reports it reached code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class, but the sources Cloudflare reviewed do not establish whether that bug is fixed in the November 19 releases (Cloudflare).
- PHP 8.1 and earlier have reached end-of-life, and PHP says CVE-2026-129289 was introduced in PHP 5.6.0, while releases older than 8.2 may also be affected by CVE-2026-115560 (Cloudflare).
- So far, there appears to be no indication that the vulnerabilities have been exploited, and its analysts will update the rules as new techniques and variations appear, Cloudflare notes (Cloudflare).