Cloudflare updated its web application firewall (WAF) on November 19, 2026, to detect attack patterns associated with phpAfterShell, a critical PHP vulnerability that can lead to remote code execution. The protection is included in Cloudflare’s Free Managed Ruleset as well as its paid Managed Ruleset, and the relevant rule is enabled by default with the action set to Block.
The vulnerability, tracked as CVE-2026-126714, was disclosed by security research company depthfirst. It affects PHP’s default file-based session handler and has a CVSS 4.0 score of 9.2 out of 10. PHP released fixes the same day in versions 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. Those releases address 17 vulnerabilities in total, including six rated critical in addition to phpAfterShell.
How phpAfterShell works
PHP normally reads session data from a file when an application calls session_start(), deserializes it into the $_SESSION array, and writes the updated session back when the request ends. phpAfterShell can occur if that write is interrupted, leaving a file that combines the beginning of new session data with the end of the previous data. On a later request, PHP may deserialize the mixed content.
For exploitation, an attacker needs a way to put controlled content in a session, an interruption at a useful point in the write, and a suitable deserialization gadget chain in the application. PHP’s advisory identifies session upload progress and applications that store large user-controlled strings in sessions as possible routes for planting data. depthfirst reported achieving code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class. The supplied information does not establish whether that second issue was fixed in the November 19 releases.
WAF coverage and related rules
Cloudflare says the PHP remote code execution rule was first deployed on October 21, 2026, following disclosure of the php2shell vulnerabilities, CVE-2026-109618 and CVE-2026-109619. The company extended the rule to CVE-2026-115560 on October 23 and refined it in subsequent weeks. Because phpAfterShell shares an attack technique with php2shell—placing serialized PHP data in session storage—the rule matched part of the newer attack pattern before its disclosure. Cloudflare updated the detection logic on November 19 and added CVE-2026-126714 to the rule description.
The rule is included in both the Free Managed Ruleset and the paid Cloudflare Managed Ruleset. Cloudflare says Free customers do not need to take action; on paid plans, the rule applies where the Managed Ruleset is deployed. The company also added three rules for other flaws to the paid Managed Ruleset: one covering a PHP-FPM request-smuggling vulnerability, CVE-2026-129289, and two for PHP SOAP extension flaws, CVE-2026-15353 and CVE-2026-129506.
Those three rules start in Log mode rather than Block. Cloudflare says the request patterns may also occur in legitimate traffic, so blocking them by default could disrupt applications. Administrators can inspect matches in Security Events and change a rule to Block after confirming that legitimate requests are not affected.
Patching remains necessary
A WAF can help block malicious data arriving in HTTP requests that pass through Cloudflare, but it cannot prevent every exploitation path. The vulnerable deserialization occurs inside PHP when it reads the session file, and user-controlled data might reach a session through a database, queue or upstream API instead of a recognizable request. A WAF also cannot address traffic that bypasses Cloudflare or server-state-dependent flaws without dedicated rules.
Cloudflare advises upgrading to a fixed PHP release and restarting the relevant services so every worker loads the updated binary. Teams should verify the version serving web requests and rebuild container images where necessary. The company also recommends checking that PHP configuration does not explicitly enable session.upload_progress.enabled, which can override the default.
For deployments that cannot be upgraded immediately, Cloudflare lists interim measures including disabling session upload progress, limiting untrusted data stored in sessions, turning off FastCGI connection reuse, and keeping PHP-FPM listeners off untrusted networks. These steps can reduce exposure but do not correct the underlying flaws. Cloudflare also says its analysts are monitoring attack activity and may update the rules as techniques change. As of November 19, it reported no indication that the vulnerabilities had been exploited in the wild; none of the 17 issues was listed in CISA’s Known Exploited Vulnerabilities catalog at that time.