Home › Intelligence › Brief
VULNERABILITY BRIEF 🔴 Critical Vulnerability

Critical phpAfterShell (CVE‑2026‑126714) Remote Code Execution Vulnerability in PHP – Cloudflare WAF Adds Default Block Rule

depthfirst disclosed phpAfterShell (CVE‑2026‑126714), a critical RCE flaw in PHP’s session handler (CVSS 9.2). Cloudflare updated its WAF to block the attack pattern on all plans and added three new rules for related PHP flaws. The case underscores the importance of coupling patch management with compensating WAF controls for audit readiness.

Verisq™ Intelligence · 📅 November 21, 2026 · 📰 blog.cloudflare.com
Get the weekly threat digestBreaches, exploited vulnerabilities and advisories that matter to your vendors, every Friday. Free.
🔴
Severity
Critical
VU
Type
Vulnerability
🎯
Confidence
High
🏢
Affected
1 sector(s)
✅
Actions
5 recommended
📰
Source
blog.cloudflare.com

Cloudflare WAF Blocks Critical phpAfterShell (CVE‑2026‑126714) Remote‑Code‑Execution Flaw in PHP

What Happened – On 19 Nov 2026 depthfirst disclosed phpAfterShell (CVE‑2026‑126714), a critical remote‑code‑execution flaw in PHP’s default file‑based session handler (CVSS 9.2). The same PHP releases also patched 16 additional vulnerabilities, six of them critical. Cloudflare responded by updating its Web Application Firewall (WAF) with a rule that blocks the known phpAfterShell attack pattern on all plans and added three new rules (PHP‑FPM request‑smuggling and two SOAP extension flaws) on paid plans. The WAF rules are enabled by default (Block for phpAfterShell, Log for the new rules) and can be tuned via the dashboard.

On 19 November 2026, the security research firm depthfirst announced a new PHP flaw dubbed phpAfterShell (CVE‑2026‑126714). The vulnerability, which resides in PHP’s default file‑based session handler, earned a Critical rating of 9.2 on the CVSS 4.0 scale. The PHP core team released patches the same day for versions 8.2.36, 8.3.37, 8.4.28, 8.5.13 and the 8.6.0 release candidates; the update also addressed sixteen additional security issues, six of them classified as critical. depthfirst’s disclosure credits Leo Lin and Asahi as the original reporters.

Cloudflare responded by extending its web‑application firewall (WAF) to block the phpAfterShell attack signatures across all customer tiers, including the Free plan. The protection builds on a PHP remote‑code‑execution rule that was first introduced in October 2026 to counter the earlier php2shell bugs; on 19 November the rule’s detection logic was broadened to cover phpAfterShell. This rule is part of both the Cloudflare Free Managed Ruleset and the broader Managed Ruleset, is enabled by default, and its default action is to Block. In the same WAF update Cloudflare added three new Managed‑Ruleset entries for paid customers: one targeting a request‑smuggling issue in PHP‑FPM (CVE‑2026‑129289) and two addressing flaws in PHP’s SOAP extension (CVE‑2026‑15353 and CVE‑2026‑129506). Because the request patterns for the latter two can appear in legitimate traffic, they are initially set to Log, allowing customers to review matches in Security Events and switch to Block if no false positives are observed.

As of the disclosure date, there was no evidence that phpAfterShell or any of the seventeen related vulnerabilities had been weaponised in the wild; none appeared in the CISA Known Exploited Vulnerabilities catalog. phpAfterShell exploits the way PHP writes session files: if the write is interrupted, the file can contain a blend of new and old data, and the next call to session_start() will deserialize the mixed content. An attacker must first inject controllable data into the session—commonly via the “session upload progress” feature or by storing large user‑controlled strings—and then cause the write interruption. depthfirst reported achieving code execution without a traditional gadget chain by chaining the flaw with an undisclosed memory‑corruption bug in a native PHP class; it is unclear whether that secondary bug was patched in the November 19 releases.

The same PHP releases also remedied six other critical bugs, each requiring specific configurations to be exploitable. These include an unauthenticated FastCGI request‑smuggling vulnerability in PHP‑FPM (CVE‑2026‑129289) that depends on front‑ends reusing FastCGI connections, a session‑serializer object‑injection issue (CVE‑2026‑115560) tied to session upload progress, and several use‑after‑free problems in timezone caching, session shutdown, and fatal‑error backtraces (CVEs 2026‑129496, 2026‑129481, 2026‑129474, 2026‑129182). Affected PHP versions are 8.2 < 8.2.36, 8.3 < 8.3.37, 8.4 < 8.4.28, 8.5 < 8.5.13, and 8.6.0 release candidates; PHP 8.1 and earlier are already end‑of‑life. While official mitigation branches for 7.4, 8.0 and 8.1 are not vulnerable to phpAfterShell, older releases may still be exposed to CVE‑2026‑129289 and CVE‑2026‑115560. Many Linux distributions backport fixes without changing the upstream version number, so administrators should verify their distro’s advisory. Cloudflare’s WAF, by filtering malicious request patterns, offers an interim shield for sites that have not yet upgraded their PHP runtimes.

Cloudflare issued an emergency release of its PHP remote‑code‑execution (RCE) rules on 21 October 2026 after the php2shell flaws (CVE‑2026‑109618 and CVE‑2026‑109619) were disclosed. The rule set was broadened on 23 October to also cover CVE‑2026‑115560 and was refined in the weeks that followed, partly using feedback from security researchers who participated in a PHP Capture‑the‑Flag challenge. Because phpAfterShell uses the same serialized‑session technique as php2shell, the original rule already caught part of its activity; on 19 November 2026 Cloudflare updated the detection logic to fully address phpAfterShell and added CVE‑2026‑126714 to the rule description.

The primary rule—identified as #6 in the Cloudflare Free Managed Ruleset (ID 19373a83abb840e18ab3ce5a7975ce1b) and in the paid Managed Ruleset (ID 4148ae686fdb4d01be673fab9d9c073d)—blocks traffic matching any of the four CVEs (109618, 109619, 115560, 126714). Three additional rules for PHP‑FPM and SOAP vulnerabilities (CVE‑2026‑129289, CVE‑2026‑15353, CVE‑2026‑129506) are part of the Cloudflare Managed Ruleset (ID efb7b8c949ac4650a09736fc376e9aee) and default to “Log” on Pro, Business and Enterprise plans; their IDs are 8ef1c34a424b4ccfa6f6fe186c6f42b2, 5c5a9d6397e44837a3214b5ba54028d4, and 00a23de67a684876ba67c5d44521b819 respectively. Customers can review matches in the Security > Analytics > Events view and, if needed, change the action to “Block” via the Cloudflare dashboard.

The WAF cannot stop every exploitation path. It can block the HTTP request that plants the malicious serialized payload, but it cannot intervene when PHP later reads the corrupted session file (the deserialization step). Payloads that originate from databases, queues or upstream APIs may never traverse the WAF, and several server‑state flaws—CVE‑2026‑129496, 129481, 129474 and 129182—rely on error logs, diagnostics or worker lifecycles, so they lack dedicated WAF rules. Traffic that bypasses Cloudflare entirely, such as internal service‑to‑service calls or direct exposure of PHP‑FPM listeners, also remains unprotected.

Business‑plan customers receive a machine‑learning “WAF attack score” (cf.waf.score.class) and Enterprise customers get a dedicated remote‑code‑execution sub‑score (cf.waf.score.rce). The model flags later‑stage payloads—shell‑execution commands, PHP eval/assert calls, or reverse‑shell strings—sent after an initial compromise, as well as traffic to dropped webshells. While the score does not identify every serialized object or FastCGI record on its own, a full exploit chain typically generates multiple requests that the model can score as malicious.

To harden deployments, Cloudflare advises confirming that the phpAfterShell rule (#6) is active (no action required on the Free plan) and switching the new PHP‑FPM and SOAP rules from “Log” to “Block” after reviewing their matches. On Business and Enterprise plans, administrators can create custom rules that block requests with low RCE scores (e.g., cf.waf.score.rce ≤ 20) or that classify as attacks (cf.waf.score.class = "attack"). The definitive mitigation remains upgrading PHP to 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0, rebuilding containers, and restarting PHP‑FPM or Apache workers. After upgrading, operators should verify that no php.ini, FPM pool or virtual‑host still sets session.upload_progress.enabled=1, as that overrides the safer default. If immediate upgrade is impossible, interim steps include disabling session.upload_progress, limiting untrusted session data, turning off FastCGI connection reuse, setting fatal_error_backtraces=0 on PHP 8.5, routing PHP errors to syslog, and ensuring PHP‑FPM listeners are not exposed to untrusted networks.

phpAfterShell converts an interrupted file write in PHP’s default session handler into code execution, and it was disclosed alongside six other critical PHP flaws. With the technical details now public, Cloudflare expects exploit attempts to increase. The WAF blocks known phpAfterShell patterns for all customers—including those on the Free plan—and the paid plans also receive rules for the PHP‑FPM and SOAP vulnerabilities, but the ultimate protection still depends on promptly upgrading PHP and restarting affected services.

Why It Matters for Trust & Control Assurance – The incident highlights the need for a formal vulnerability‑management control that couples timely patching with compensating WAF rules, providing continuous, auditable evidence of risk mitigation.

Who Is Affected – Any organization that runs PHP 8.2‑8.6 (or back‑ported distributions) for web‑applications, including SaaS providers, e‑commerce sites, and managed‑hosting platforms.

Recommended Actions –

  1. Upgrade all PHP runtimes to the patched versions (8.2.36, 8.3.37, 8.4.28, 8.5.13, or 8.6.0).
  2. Verify that Cloudflare’s “PHP Remote Code Execution Attack #6” rule is active and set to Block.
  3. Review the new PHP‑FPM and SOAP rules in the Managed Ruleset; switch from Log to Block after confirming no false positives.
  4. Harden session handling (disable session.upload_progress, limit user‑controlled data in sessions, turn off FastCGI connection reuse).
  5. Enable Cloudflare WAF attack‑score rules for additional detection of post‑exploitation payloads.

Technical Notes – The flaw exploits an interrupted write to a session file, allowing an attacker‑controlled serialized object to be deserialized on the next request. Exploitation requires a second, undisclosed memory‑corruption bug; no public exploits are known yet. Cloudflare’s WAF can block the initial payload injection but cannot see the deserialization step inside PHP. Source: Cloudflare Security Blog

📰 Original Source
https://blog.cloudflare.com/phpaftershell-waf-protection/ ↗

This Verisq Intelligence Brief is an independent analysis. Read the original reporting at the link above.

Vulnerability exposure

Is this CVE in your supply chain?

Verisq matches published vulnerabilities against the software your vendors run, so you know which relationships this touches before the next review.

See vendor exposure →