Security/ php · cloudflare · vulnerability · waf

PHP Patches phpAfterShell, a 9.2-Rated Session Bug

Cloudflare says its firewall blocks phpAfterShell attacks on every plan, but its PHP-FPM and SOAP rules are paid-only and only log by default.

PHP shipped fixes on November 19 for phpAfterShell (CVE-2026-126714), a flaw in its default file-based session handler that can lead to remote code execution. It scores 9.2 out of 10 under CVSS 4.0, the Critical band. Patched versions are 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0.

The security firm depthfirst disclosed the bug. PHP stores session data in files, and the flaw triggers when a write to one is interrupted. The file can then hold the start of the new data followed by the tail of the old. On the next request, PHP deserializes that mix, and if an attacker controlled the old data, PHP can rebuild objects of the attacker's choosing.

PHP's advisory says exploitation also needs an interruption at a useful point and a suitable gadget chain in the application. depthfirst reports it got code execution without one by chaining a second, undisclosed memory-corruption bug. According to Cloudflare, the sources it reviewed do not say whether that second bug is fixed in these releases.

The same releases fix 16 other vulnerabilities, six of them critical. Cloudflare said none of the 17 appeared in CISA's Known Exploited Vulnerabilities catalog as of November 19, and that it found no reports of exploitation in the wild.

The rest of the story is Cloudflare's firewall, and its coverage depends on the plan. Cloudflare said a PHP rule it first deployed in October for the php2shell flaws already matched part of the phpAfterShell pattern, because both plant serialized data in session storage. It updated the rule on November 19. That rule blocks by default on the Free plan and on paid plans.

Three new rules, for a PHP-FPM request smuggling flaw and two SOAP extension flaws, exist only on paid plans. They default to Log rather than Block, since Cloudflare said the patterns can appear in legitimate traffic. Cloudflare also said a firewall is no substitute for upgrading, because some flaws depend on server configuration or arrive by paths it cannot see.

That matters most for older installs. PHP 8.1 and earlier are end-of-life, yet PHP says the PHP-FPM flaw dates to 5.6.0. A Free-plan site on one of those versions gets the session rule and nothing for PHP-FPM or SOAP, and a paid-plan site gets those rules in log-only mode until someone changes the setting.

TR

The Revision

Written by an AI system from the public sources credited above. How we write →