On November 19, 2026, the security research firm depthfirst revealed phpAfterShell (CVE-2026-126714), a flaw affecting PHP's default file-based session handler that permits remote code execution. The vulnerability carries a CVSS 4.0 score of 9.2 out of 10, marking it as critical. The PHP project released patches the same day across versions 8.2.36, 8.3.37, 8.4.28, 8.5.13, and 8.6.0, which also address 16 additional security issues, including six rated as critical.
Cloudflare's web application firewall (WAF) now blocks known phpAfterShell attack patterns across all customer tiers, including those on the Free plan. The protection leverages a PHP remote code execution rule initially deployed in October 2026 to defend against php2shell vulnerabilities. This existing rule already caught portions of the phpAfterShell attack pattern prior to public disclosure, and on November 19 Cloudflare refined its detection to fully cover phpAfterShell. The rule operates within both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset, is enabled by default, and blocks traffic by default.
The same WAF update introduced three additional rules for paid plan subscribers: one targeting a request smuggling vulnerability in PHP-FPM (CVE-2026-129289), and two addressing flaws in PHP's SOAP extension (CVE-2026-15353 and CVE-2026-129506) that received fixes in the November 19 releases. These rules are enabled by default with a Log action, since the request patterns they identify can also occur in legitimate traffic. Blocking by default could disrupt normal operations. Customers can examine matching requests through Security Events and switch the action to Block after confirming the rules do not interfere with legitimate activity.
The WAF functions as an additional defensive layer rather than a substitute for patching. Several critical flaws depend on particular server configurations or can be reached through traffic paths the WAF cannot inspect. Complete remediation requires upgrading PHP and restarting all worker processes. Cloudflare's security team continues tracking attack activity and will refine rules as new exploitation techniques and variations emerge. Rule updates are available in the WAF changelog, and vulnerability developments can be followed in the dedicated Cloudflare Zero Wire briefing.
No evidence has surfaced indicating these vulnerabilities have been actively exploited. As of November 19, 2026, none of the 17 vulnerabilities appeared in CISA's Known Exploited Vulnerabilities catalog, and no reports reviewed documented exploitation in the wild.
Understanding phpAfterShell
PHP stores session information in files by default. When an application invokes session_start(), PHP loads the session file and deserializes its contents into the $_SESSION array. Upon request completion, PHP writes the updated session back to the same file.
phpAfterShell activates when that write operation gets interrupted. The session file can then contain the start of new session data appended to the end of old data. During the next request, session_start() deserializes this mixed content. If an attacker controlled the old data, PHP may deserialize objects of the attacker's choosing.
An attacker exploiting this flaw must first identify a method to inject controlled data into the session. PHP's advisory identifies two approaches:
- Session upload progress, a PHP feature that records file upload information into the session. A remote client can manipulate this to shape stored data.
- Applications that retain large user-controlled strings within the session.
According to PHP, code execution additionally requires an interruption at a strategic moment during the write and a suitable deserialization gadget chain in the application. depthfirst reports achieving code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class. Available sources do not clarify whether that second bug is resolved in the November 19 releases.
depthfirst discovered and reported phpAfterShell. The CVE record credits Leo Lin and Asahi as reporters.
The six additional critical flaws
The same releases patch six more critical vulnerabilities. Each requires specific configuration to be exploitable:
- An unauthenticated attacker can inject a second FastCGI request into PHP-FPM and execute PHP code as the worker. Requires: a front end reusing backend FastCGI connections (nginx with fastcgi_keep_conn on, Apache mod_proxy_fcgi with enablereuse=on, or HAProxy), an application path that opens php://input without fully reading it, and the path of an existing PHP script.
- Object injection through serializer mismatch between sessions. First documented in the php2shell briefing, now fixed. Requires: session upload progress enabled. PHP expanded the scope to include applications, pools or command-line jobs using different serializers and sharing a session store.
- Use-after-free that can crash a fresh worker and potentially execute code. PHP demonstrated code execution locally with known memory addresses. Requires: non-thread-safe builds where a startup diagnostic has been written to a PHP error log file.
- Use-after-free described by PHP as an incomplete fix for CVE-2026-109619. No code execution demonstrated. Requires: PHP 8.3 and later.
- Use-after-free in magic method backtraces. Requires: PHP 8.5 and later, where fatal error backtraces are enabled by default. Setting zend.exception_ignore_args=1, the php.ini-production default, blocks the demonstrated attack.
- Use-after-free. No code execution demonstrated. Requires: PHP 8.5, specific path-level settings, and an Apache per-directory configuration or front end that produces an early diagnostic.
Who is affected
Vulnerable versions include 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. Whether a deployment faces exposure depends on the conditions of each flaw.
PHP 8.1 and earlier have reached end-of-life. depthfirst states that the official 7.4, 8.0 and 8.1 end-of-life mitigation branches are unaffected by phpAfterShell, but PHP indicates CVE-2026-129289 was introduced in PHP 5.6.0 and that releases older than 8.2 may also be vulnerable to CVE-2026-115560.
Linux distributions frequently backport fixes without updating the PHP version number. Compare the complete package version against your distribution's advisory.
How Cloudflare WAF protects you
PHP powers a substantial portion of the web, frequently embedded in content management systems, plugins, and container images that teams do not update directly. Patching every PHP runtime requires time. Cloudflare WAF reduces exposure while you patch.
phpAfterShell: protection on every plan
Cloudflare released the original PHP remote code execution rules in an emergency deployment on October 21, 2026, following disclosure of the php2shell vulnerabilities (CVE-2026-109618 and CVE-2026-109619). The rules were extended to CVE-2026-115560 on October 23 and refined multiple times in subsequent weeks, drawing partly on feedback from security researchers participating in a PHP Capture the Flag (CTF) challenge.
phpAfterShell employs an attack technique shared with php2shell: an attacker deposits serialized PHP data in session storage and awaits PHP deserialization. Due to this overlap, the existing rule already matched portions of the phpAfterShell attack pattern before disclosure. On November 19, Cloudflare updated the rule's detection logic to encompass phpAfterShell and added CVE-2026-126714 to its description.
The rule PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619, CVE-2026-115560, CVE-2026-126714) #6 is included in both the Cloudflare Free Managed Ruleset (Free plan) and the Cloudflare Managed Ruleset (Pro, Business and Enterprise plans).
Free plan customers need not take action. On paid plans, the rule is active wherever the Cloudflare Managed Ruleset is deployed. The Zero Wire briefing contains links to access the rules directly in your dashboard.
New rules for PHP-FPM and SOAP flaws
The three new rules are part of the Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee) and are available on Pro, Business and Enterprise plans.
To examine their matches, navigate to Security > Analytics > Events and filter by rule ID. If the matches represent legitimate traffic, change the rule action to Block: go to Security > Settings, edit the Cloudflare Managed Ruleset, search for the CVE identifier and set the rule action to Block, or use the links in the Zero Wire briefing to access the rules configuration directly.
What the WAF cannot see
A WAF can block an exploit when malicious data arrives in an HTTP request passing through Cloudflare. It cannot block every path to these vulnerabilities:
- The deserialization step. phpAfterShell's final stage occurs inside PHP when it reads a corrupted session file. The WAF can block requests that plant the payload, not the read itself.
- Session data from other sources. If an application copies user-controlled data into the session from a database, a queue or an upstream API, that data may never traverse the WAF in a recognizable form.
- Flaws triggered by server state. CVE-2026-129496, CVE-2026-129481, CVE-2026-129474 and CVE-2026-129182 depend on error logs, diagnostics and worker lifecycle. They lack dedicated WAF rules, and the patch and configuration changes are the way to address them.
- Traffic that bypasses Cloudflare. This includes internal traffic between services and PHP-FPM listeners exposed directly to a network.
Adding defense in depth with WAF attack score
WAF attack score adds a machine learning layer that scores each request for attack payloads. It is available on Business plans (cf.waf.score.class) and, with a dedicated remote code execution sub-score (cf.waf.score.rce) along with an overall score (cf.waf.score), on Enterprise plans.
Attack score complements the managed rules. It will not recognize every serialized object or smuggled FastCGI record independently, but a working exploit chain typically requires more than one request, and the later stages carry payloads the model is trained to score:
- Second-stage payloads. Once an attacker can run code, they still need to send commands: shell execution primitives (/bin/sh -c, system(), passthru()), PHP code evaluation (eval(), assert()) or reverse-shell strings in headers, query parameters or request bodies.
- Webshell traffic. Attackers often drop a small PHP webshell after the initial compromise. Requests that pass operating system commands to that webshell remain visible to attack score.
Deploy protections and patch
Additional information on deploying managed rules and attack score is available in the WAF guide. In summary:
- Check that phpAfterShell protection is active. On the Free plan, no action is needed. On paid plans, ensure the Cloudflare Managed Ruleset is deployed and that the PHP Remote Code Execution Attack #6 rule is set to Block.
- Review the new rules and switch them to Block. The CVE-2026-129289, CVE-2026-15353 and CVE-2026-129506 rules are in Log mode by default. Review their matches in Security Events, then change their action to Block.
- Layer attack score. Create a custom rule that blocks or challenges requests with a low remote code execution score, for example
cf.waf.score.rce le 20on Enterprise plans, orcf.waf.score.class eq "attack"on Business plans. - Upgrade PHP. Move to 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0. Rebuild container images and restart the PHP-FPM master or Apache so every worker loads the new binary, then verify the version that serves web requests. After upgrading, check that no php.ini, FPM pool or virtual host still sets session.upload_progress.enabled=1, because an explicit setting overrides the new default.
- Apply interim mitigations if you cannot upgrade right away. Set session.upload_progress.enabled=0 and limit the untrusted data you store in sessions. Turn off FastCGI connection reuse. On PHP 8.5, set fatal_error_backtraces=0. Fix configuration errors that produce PHP startup warnings, or send PHP errors to syslog instead of a file. Keep PHP-FPM listeners off untrusted networks. These steps reduce exposure; they do not fix the flaws.
For a prompt you can provide to an AI agent to inventory your PHP deployments and check each one against all seven critical CVEs, see the phpAfterShell page on Cloudflare Zero Wire.
Update every PHP runtime now
phpAfterShell transforms an interrupted file write in PHP's default session handler into a path to code execution, and it arrived alongside six other critical flaws. With technical details now public, exploit attempts are expected to follow. Cloudflare WAF blocks known phpAfterShell attack patterns for every customer, including the Free plan, and paid plans have new rules for the PHP-FPM and SOAP flaws. The complete fix remains upgrading PHP and restarting the services that use it.