How Cloudflare WAF helps protect against phpAfterShell and other critical
Cloudflare updated its WAF rules to block phpAfterShell exploits across all plans as PHP released patches for 17 flaws, including seven rated critical.
By Dillip Chowdary • Nov 21, 2026 • Source: Cloudflare Blog

At a glance
- Product
- Cloudflare WAF
- Vulnerability
- phpAfterShell (CVE-2026-126714)
- CVSS score
- 9.2 Critical
- Release date
- November 19, 2026
- Availability
- Free, Pro, Business, Enterprise
- Patched versions
- PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0
In this post
Cloudflare updated its web application firewall detection rules on November 19, 2026, blocking attack patterns aimed at phpAfterShell across all service tiers, including Free accounts. According to Cloudflare Blog's report, the critical vulnerability carries a CVSS 4.0 score of 9.2 out of 10 and affects PHP's default file-based session handler, allowing remote code execution when session writes are interrupted. The PHP project patched the issue alongside 16 other security flaws in maintenance releases across versions 8.2 through 8.6.
This report details the technical mechanics of phpAfterShell, Cloudflare's firewall mitigations, and the broader bundle of six additional critical PHP flaws addressed simultaneously. It serves system administrators, security teams, and infrastructure operators running PHP workloads behind reverse proxies or content management platforms. While managed edge rules offer immediate perimeter filtering, server administrators must still deploy upstream engine updates to eliminate backend exploit paths.
01Interrupted writes and session deserialization
PHP relies on files to manage session state by default. An application invokes session_start() to deserialize session file contents into the global session array, and writes updated data back when execution terminates. If that file write process gets interrupted, the stored session file retains a hybrid mixture containing the beginning of incoming data followed by remnants of older session data.
When the application initiates subsequent requests, session_start() deserializes this corrupted, mixed content. Attackers who manipulate the prior session data can force PHP into deserializing unauthorized objects. Exploitation requires planting controlled data into the session store via session upload progress features or application fields that accept large user-controlled inputs.
Achieving arbitrary code execution requires an interruption during writing alongside an application gadget chain. Security research company depthfirst, credited alongside Leo Lin and Asahi for reporting the vulnerability, disclosed that code execution was also achieved without application gadgets by chaining a second, undisclosed memory-corruption flaw in a PHP-native class.
02Managed ruleset deployment and edge blocking
Cloudflare deployed its core PHP remote code execution defense rule in an emergency update on October 21, 2026, following the earlier php2shell vulnerabilities. Because phpAfterShell relies on an overlapping technique of planting serialized PHP data inside session storage, the existing firewall pattern already matched portions of the incoming traffic signatures before disclosure occurred.
On November 19, 2026, Cloudflare adjusted the rule logic to fully cover phpAfterShell under identifier CVE-2026-126714. This rule operates with a default Block action on both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset for paid tiers. Free plan customers receive the protection automatically without manual dashboard intervention.
For paid Pro, Business, and Enterprise tiers, Cloudflare also introduced three additional rules covering request smuggling and SOAP extension flaws. These supplemental rules default to a Log action to prevent disruptions against legitimate application payloads, allowing administrators to audit matches in Security Events before toggling them to Block.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
03Critical flaw parameters across engine components
The November 19 PHP maintenance release corrected six other vulnerabilities classified as critical. Each vulnerability demands specific runtime environments, web server setups, or configuration flags before an attacker can achieve exploitation.
| CVE | Component | Impact | Conditions |
|---|---|---|---|
| CVE-2026-129289 | PHP-FPM | FastCGI request smuggling and code execution | FastCGI connection reuse with unread php://input streams |
| CVE-2026-115560 | Session serializer | Object injection | Active session upload progress across mismatched serializers |
| CVE-2026-129496 | Timezone cache | Worker crash and possible code execution | Non-thread-safe builds logging startup diagnostics to disk |
| CVE-2026-129481 | Session shutdown | Memory use-after-free | PHP 8.3 and later runtimes |
| CVE-2026-129474 | Fatal error backtraces | Use-after-free during magic method backtraces | PHP 8.5 and later with default backtrace settings enabled |
| CVE-2026-129182 | Fatal error backtraces | Memory use-after-free | PHP 8.5 with specific directory diagnostic configurations |
04Version exposure and platform upgrade boundaries
The primary vulnerability impacts PHP versions 8.2 prior to 8.2.36, 8.3 prior to 8.3.37, 8.4 prior to 8.4.28, 8.5 prior to 8.5.13, and 8.6.0 release candidates. Releases 8.1 and older have reached official end-of-life status. While depthfirst stated that official end-of-life branches for 7.4, 8.0, and 8.1 are not affected by phpAfterShell, earlier branches remain vulnerable to legacy issues such as CVE-2026-129289.
Linux distribution maintainers regularly backport security corrections without incrementing base version numbers. Systems operators must verify individual package release strings against OS-level security bulletins to establish real patch status.
Note: Cloudflare WAF acts as perimeter defense rather than a full patch replacement, as several flaws depend on internal configuration and internal paths hidden from edge proxies.
05Audit procedures and firewall configuration steps
Administrators using paid Cloudflare plans can review matches for the newly introduced PHP-FPM and SOAP rules within the security management console. The transition from monitoring to active enforcement requires manual verification.
- Open security analytics Navigate to Security, select Analytics, open Events, and filter records by the target rule identifier.
- Review matching requests Inspect recorded requests to confirm that logged events represent malicious probes rather than regular application traffic.
- Switch rule action Open Security Settings, select Cloudflare Managed Ruleset, locate the CVE record, and change the enforcement action to Block.
As of November 19, 2026, none of the 17 patched vulnerabilities were listed in the Cybersecurity and Infrastructure Security Agency Known Exploited Vulnerabilities catalog. No public telemetry indicates active in-the-wild exploitation.
Frequently asked questions
What is phpAfterShell?
It is a critical remote code execution vulnerability in PHP's default session handler caused by interrupted file writes that deserialize mixed session contents.
Does Cloudflare Free plan include protection against phpAfterShell?
Yes, the Free Managed Ruleset includes the PHP remote code execution rule set to Block by default.
Why are the new PHP-FPM and SOAP rules set to Log instead of Block?
Cloudflare set them to Log on paid tiers because their detection patterns can match legitimate web traffic, allowing administrators to audit requests first.
Has phpAfterShell been exploited in the wild?
As of November 19, 2026, there was no reported exploitation in the wild and no listing in CISA's Known Exploited Vulnerabilities catalog.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement