PHP’s default session handler writes session data to disk with two separate system calls: pwrite(), then ftruncate(). Nothing guarantees both run before the process disappears. On November 19, 2026, PHP shipped 8.2.36, 8.3.37, 8.4.28, 8.5.13 and the new 8.6.0, fixing what happens when that gap gets exploited: phpAfterShell, tracked as CVE-2026-126714, scored 9.2 out of 10 under CVSS 4.0 and disclosed the same day by the security research firm depthfirst.

The same release closes 16 other holes, six of them also rated 9.2, as Cloudflare’s security team wrote up when it extended its web application firewall rules to cover the new bug. PHP’s own count is 17 CVEs across the four branches and 8.6.0; a separate tally by security firm Aikido, reported by BleepingComputer, puts the total at 18. Neither article explains the one-CVE gap, and it likely comes down to whether a duplicate or sub-variant entry gets counted separately — the critical count, seven flaws at 9.2 each, is the same in both tallies.

How a session write becomes a shell

PHP’s files session handler stores each visitor’s session as one serialized string in one file. When session_start() runs, PHP reads that file and deserializes it into the $_SESSION array; when the request ends, PHP writes the updated string back with pwrite() at offset zero, then calls ftruncate() to drop whatever is left over from the previous, longer version. If the worker dies or is killed between those two calls, the file on disk is a splice: the start of the new session followed by the tail of the old one. The next request’s session_start() deserializes that splice as if it were one valid session.

A stylized printing press cuts a flowing strip of teal and navy material.

depthfirst’s write-up names two ways an attacker gets to pick what ends up in the old, overwritten half: PHP’s session.upload_progress feature, which writes live file-upload status into the session and was on by default before this patch, or an application that stores large, attacker-influenced strings in the session directly. PHP’s advisory says getting from there to code execution still needs the interrupt to land at a useful point in the write and a deserialization gadget chain in the application. depthfirst says it skipped the second requirement by chaining phpAfterShell to a separate, undisclosed memory-corruption bug in a PHP-native class, reaching code execution without needing an application-specific gadget at all. None of the material reviewed establishes whether that second bug is itself fixed in the November 19 releases.

depthfirst reports two ways to force the interrupt: triggering the out-of-memory killer during the write, or timing a worker’s death between the pwrite() and the ftruncate() that follows. In its research write-up, the firm says its automated controller reached a working exploit within 10 to 11 attempts in fresh test runs, each attempt using a new session ID across three requests. depthfirst credits its own AI research platform with finding the bug; the CVE record itself lists Leo Lin and Asahi as reporters. A separate, unrelated exploit lab for the same CVE, published on GitHub by the researcher tani2shell, claims its own automated pentest agent reproduced the chain against a synthetic target in 19 minutes — a lab demonstration, not evidence the bug has been exploited against a real service.

The six other critical bugs in the same release each need their own precondition, and each lands in a different part of PHP. Two are incomplete fixes for php2shell, the pair of flaws PHP patched in October (covered here): PHP’s advisory says neither has a demonstrated path to code execution, only to memory corruption or a crashed worker. One, a FastCGI request-smuggling bug in PHP-FPM (CVE-2026-129289), needs a front end that reuses backend connections — a non-default setting in standard Nginx or Apache configurations, but a common one behind load balancers. The rest need specific server states: a non-thread-safe build logging a startup diagnostic, or PHP 8.5’s magic-method backtrace handling.

Seven critical bugs, one release All scored 9.2 under CVSS 4.0, per PHP's advisory
CVEMechanismCondition neededCloudflare WAF
CVE-2026-126714 (phpAfterShell)Session write race → deserializationFile sessions (default) + upload progress or stored user dataBlock, free & paid, updated Nov 19
CVE-2026-129289PHP-FPM FastCGI request smugglingBackend connection reuse + unread php://inputLog, paid only, new rule
CVE-2026-115560Session serializer mismatch → object injectionUpload progress enabled, mismatched serializersBlock, free & paid, since Oct 23
CVE-2026-129496Timezone cache use-after-freeNon-thread-safe build + startup diagnostic to error logNone, patch only
CVE-2026-129481Session shutdown use-after-freePHP 8.3 and laterNone, patch only
CVE-2026-129474Magic-method backtrace use-after-freePHP 8.5 and laterNone, patch only
CVE-2026-129182Backtrace use-after-free, second pathPHP 8.5 + specific front-end diagnosticsNone, patch only

Source: Cloudflare and PHP security advisory

Who is exposed, and who isn’t

The vulnerable range is 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 any given install is actually reachable depends on which of the seven critical conditions it meets — Cloudflare’s advisory notes that Linux distributions frequently backport these fixes without changing the version string PHP reports, so checking the full package version against a distribution’s own advisory matters more than checking php -v. PHP 8.1 and earlier are end-of-life; depthfirst says the maintained end-of-life branches for 7.4, 8.0 and 8.1 are not affected by phpAfterShell specifically, but PHP’s own advisory says the PHP-FPM smuggling bug, CVE-2026-129289, traces back to PHP 5.6.0, and that the session-serializer bug, CVE-2026-115560, may also affect releases older than 8.2.

What the filter catches, and what it can’t

Cloudflare’s phpAfterShell coverage is a side effect of an older rule, not a new one. The company deployed a PHP remote-code-execution rule in an emergency release on October 21, 2026, for the original php2shell flaws, extended it to CVE-2026-115560 two days later, and refined it over the following weeks partly using reports from a public PHP capture-the-flag exercise. Because phpAfterShell uses the same technique as php2shell — planting serialized PHP data in session storage and waiting for PHP to deserialize it — that rule already matched part of the new attack pattern before depthfirst’s disclosure. Cloudflare updated its detection logic on November 19 and says the rule is active by default, action Block, on both the Free Managed Ruleset and the paid Cloudflare Managed Ruleset, so free-tier customers needed to do nothing.

Three further rules went into the paid Managed Ruleset only (ruleset ID efb7b8c949ac4650a09736fc376e9aee, on Pro, Business and Enterprise plans): one for the PHP-FPM smuggling bug, two for a pair of SOAP-extension flaws, CVE-2026-15353 and CVE-2026-129506, that shipped in the same PHP release but aren’t among the seven criticals. All three default to Log rather than Block, because the request shapes they match can also appear in ordinary traffic; Cloudflare’s advice is to watch Security Analytics for a few days before switching them to Block.

A chain-link barrier blocks dark, red-eyed creatures in a flowing teal river beneath a large red sun.

A proxy rule can only act on an HTTP request that passes through it in a recognizable shape. Cloudflare’s own advisory lists what that misses: the deserialization itself, which happens inside PHP when it reads the corrupted session file, not on the wire; session data an application copies in from a database, a queue or an upstream API, which may never look like an attack payload at the edge; the four use-after-free bugs that depend on server state — error logs, startup diagnostics, worker lifecycle — rather than request content, for which there is no rule at all; and any traffic that reaches PHP-FPM without going through Cloudflare, including internal service calls and FastCGI listeners exposed directly to a network.

Cloudflare’s WAF Attack Score, a machine-learning layer scored per request, adds a second line of defense on Business and Enterprise plans — Enterprise also gets a dedicated remote-code-execution sub-score. It doesn’t recognize a smuggled FastCGI record or a serialized object on its own, but a working exploit chain usually needs a second request after the initial corruption: a shell command, an eval() or assert() call, or traffic to a dropped webshell, all of which the model is trained against. That makes it useful against what happens after the session file is corrupted, not against the corruption step itself.

As of the disclosure date, none of the 17 (or 18) CVEs in this release appears in CISA’s Known Exploited Vulnerabilities catalog, and no outlet reviewed reports exploitation in the wild. That is a measured absence, not a guarantee: PHP, by Cloudflare’s own framing, runs inside content management systems, plugins and container images that teams rarely patch directly, and the gap between a 9.2 advisory and a confirmed in-the-wild exploit has, in PHP’s recent history, run from zero days to several weeks. The open item is the bug depthfirst chained in to skip the gadget-chain requirement: nothing in PHP’s advisory or depthfirst’s own write-up says whether it is patched, or still sitting in the same 8.2.36 through 8.6.0 builds everyone is now told to install.