depthfirst disclosed phpAfterShell (CVE-2026-126714) on November 19, 2026, a remote code execution flaw in PHP's default file-based session handler that carries a CVSS 4.0 score of 9.2 (Critical). PHP shipped fixes the same day in 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0, releases that also close 16 other vulnerabilities, six of them rated critical.

Cloudflare's WAF blocks known phpAfterShell patterns on every plan, Free included. The coverage comes from a PHP remote code execution rule first deployed in October 2026 for the php2shell vulnerabilities. That rule already matched part of the phpAfterShell pattern before disclosure; on November 19 its detection logic was extended to the new flaw. It sits in both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset, is enabled by default, and its default action is Block.

How the session handler is subverted

By default PHP keeps session data in files: session_start() reads the session file and deserializes its contents into the $_SESSION array, and at request end the updated data is written back to the same file. If that write is interrupted, the file can end up holding the start of the new session data followed by the tail of the old. The next session_start() deserializes the mixed content, and if the stale data was attacker-controlled, PHP deserializes objects of the attacker's choosing.

Placing controlled data in the session is the first step. PHP's advisory names session upload progress — a feature that records upload state in the session — and applications that keep large user-supplied strings in the session as two routes. PHP also requires an interruption at a useful moment in the write and a suitable deserialization gadget chain in the application. depthfirst reports reaching code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class; the sources reviewed here do not establish whether the November 19 releases fix that second bug.

depthfirst says it discovered and reported phpAfterShell; the CVE record credits Leo Lin and Asahi.

The other flaws and affected versions

The six additional critical bugs each require a specific configuration to be exploitable.

CVE

Component

Impact

Conditions

CVE-2026-129289

PHP-FPM

An unauthenticated attacker can smuggle a second FastCGI request into PHP-FPM and run PHP code as the worker.

A front end that reuses 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 reading it to the end, and the path of an existing PHP script.

CVE-2026-115560

Session serializer

Object injection through a mismatch between session serializers. First covered in our php2shell briefing, now fixed.

Session upload progress enabled. PHP widened the scope: applications, pools or command-line jobs that use different serializers and share a session store are affected.

CVE-2026-129496

Timezone cache

Use-after-free that can crash a fresh worker and possibly run code. PHP demonstrated code execution locally with known memory addresses.

Non-thread-safe builds where a startup diagnostic has been written to a PHP error log file.

CVE-2026-129481

Session shutdown

Use-after-free, described by PHP as an incomplete fix for CVE-2026-109619. No code execution demonstrated.

PHP 8.3 and later.

CVE-2026-129474

Fatal error backtraces

Use-after-free in magic method backtraces.

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.

CVE-2026-129182

Fatal error backtraces

Use-after-free. No code execution demonstrated.

PHP 8.5, specific path-level settings, and an Apache per-directory configuration or front end that produces an early diagnostic.

Vulnerable releases 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. PHP 8.1 and earlier are end-of-life: depthfirst says the official 7.4, 8.0 and 8.1 mitigation branches are unaffected by phpAfterShell, while PHP notes that CVE-2026-129289 was introduced in 5.6.0 and that versions older than 8.2 may also be exposed to CVE-2026-115560. Distributions commonly backport fixes without changing the version number, so compare the full package version against the distribution advisory.

WAF rule coverage

The original PHP remote code execution rules went out in an emergency release on October 21, 2026 after the php2shell vulnerabilities (CVE-2026-109618 and CVE-2026-109619) were disclosed. They were extended to CVE-2026-115560 on October 23 and refined over the following weeks, partly on reports from researchers who joined a PHP Capture the Flag challenge. phpAfterShell reuses the php2shell technique — plant serialized PHP data in session storage, wait for deserialization — which is why the existing rule caught part of the pattern before public disclosure; the November 19 update added CVE-2026-126714 to its description.

Rule description

Rule ID

Ruleset

Default action

PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619, CVE-2026-115560, CVE-2026-126714) #6

19373a83abb840e18ab3ce5a7975ce1b

Cloudflare Free Managed Ruleset (Free plan)

Block

PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619, CVE-2026-115560, CVE-2026-126714) #6

4148ae686fdb4d01be673fab9d9c073d

Cloudflare Managed Ruleset (Pro, Business and Enterprise plans)

Block

Free plan customers need not act. On paid plans the rule is active wherever the Cloudflare Managed Ruleset is deployed.

The same WAF release added three rules to the Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee) for Pro, Business and Enterprise plans: CVE-2026-129289, a request smuggling flaw in PHP-FPM, and two SOAP extension flaws, CVE-2026-15353 and CVE-2026-129506. Because the request patterns they match can also occur in legitimate traffic, all three default to Log. Matches can be reviewed in Security Events now, and the action changed to Block once the rules are confirmed not to hit legitimate traffic.

Rule description

Rule ID

Default action

PHP-FPM - CVE:CVE-2026-129289

8ef1c34a424b4ccfa6f6fe186c6f42b2

Log

PHP SOAP - CVE:CVE-2026-15353

5c5a9d6397e44837a3214b5ba54028d4

Log

PHP SOAP - CVE:CVE-2026-129506

00a23de67a684876ba67c5d44521b819

Log

Gaps a WAF cannot close

The WAF is an extra layer of defense, not a substitute for the patch. Several critical flaws depend on server configuration or are reachable through paths Cloudflare does not see:

  • The deserialization itself. phpAfterShell's final step runs inside PHP when it reads the corrupted session file. A WAF can block the requests that plant the payload, not the read.
  • Session data from other sources. Data copied into the session from a database, a queue or an upstream API may never cross the WAF in recognizable form.
  • State-triggered flaws. CVE-2026-129496, CVE-2026-129481, CVE-2026-129474 and CVE-2026-129182 depend on error logs, diagnostics and worker lifecycle, have no dedicated WAF rules, and need the patch plus configuration changes.
  • Traffic that bypasses Cloudflare, including internal service-to-service traffic and PHP-FPM listeners exposed directly to a network. Keep FPM listeners off untrusted networks.

WAF attack score supplies a machine-learning layer that scores each request for attack payloads: cf.waf.score.class on Business plans, and on Enterprise a dedicated remote code execution sub-score (cf.waf.score.rce) alongside the overall cf.waf.score. It will not identify every serialized object or smuggled FastCGI record by itself, but an exploit chain usually spans multiple requests, and later stages carry payloads the model is trained on: shell primitives (/bin/sh -c, system(), passthru()), code evaluation (eval(), assert()), reverse-shell strings in headers, query parameters or bodies, and commands sent to a dropped PHP webshell.

Deployment checklist

  1. Confirm phpAfterShell coverage. On Free, nothing is needed. On paid plans, verify the Cloudflare Managed Ruleset is deployed and the PHP Remote Code Execution Attack #6 rule is set to Block.
  2. Review the three new rules and switch them to Block. Filter Security > Analytics > Events by rule ID, then edit the ruleset under Security > Settings, search the CVE identifier and change the action.
  3. Layer attack score. Add a custom rule that blocks or challenges requests with a low RCE score — for example cf.waf.score.rce le 20 on Enterprise, or cf.waf.score.class eq "attack" on Business.
  4. Upgrade PHP to 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0. Rebuild container images, restart the PHP-FPM master or Apache so every worker loads the new binary, and verify the version serving requests. Then check that no php.ini, FPM pool or virtual host still sets session.upload_progress.enabled=1, since an explicit setting overrides the new default.
  5. Apply interim mitigations if the upgrade must wait. Set session.upload_progress.enabled=0, limit untrusted data stored in sessions, turn off FastCGI connection reuse, set fatal_error_backtraces=0 on PHP 8.5, fix configuration errors that emit startup warnings or route PHP errors to syslog, and keep FPM listeners off untrusted networks. These reduce exposure; they do not fix the flaws.

As of November 19, 2026, none of the 17 vulnerabilities appears in CISA's Known Exploited Vulnerabilities catalog, and no source reviewed reports exploitation in the wild. With technical details now public, exploit attempts are expected to follow. Rule changes are tracked in the WAF changelog, and the dedicated Cloudflare Zero Wire briefing follows the vulnerabilities' development and provides links straight to the relevant rules in the dashboard.