Title: phpAfterShell: PHP’s Default File Sessions Can Be Spliced Into Arbitrary Object Loading — November Releases Fix Seven CVSS 9.2 Flaws
Summary:
On November 19, 2026, the PHP project shipped 8.2.36, 8.3.37, 8.4.28, 8.5.13 and the new 8.6.0, closing eight flaws — seven rated 9.2 and one rated 8.8 — that the maintainers had previewed as critical issues requiring non-default configurations or uncommon setups. The headline bug is CVE-2026-126714, codenamed phpAfterShell by Depthfirst: a TOCTOU problem (CWE-367/CWE-662) in the default files session save handler, where ps_files_write() overwrites an existing session file without clearing it first, so a write that dies partway through — in threaded PHP builds, another thread hitting the memory limit hard enough to kill the process mid-write is one trigger — can leave a file that opens as the new session but ends with leftover bytes from the previous one. By shaping length fields in the new data, an attacker can make PHP’s session decoder treat leftover bytes as serialized objects; a later session_start() instantiates them, and with a suitable deserialization gadget chain — Depthfirst used a second, undisclosed memory-corruption bug in a PHP-native class — this turns into arbitrary code running under the PHP worker’s account, or degrades into session tampering and identity spoofing. Per the maintainers’ advisory, the code has been present since PHP 4.1.0, is not limited to upload progress, and CVSS 4.0 scores it 9.2 (AV:N/AC:L/AT:P/PR:N/UI:N with high C/I/A); neither the maintainers nor Depthfirst report any attacks in the wild. The patched code empties the session file completely before writing the replacement and abandons the write if that emptying does not succeed; the releases also turn upload progress off by default, so applications that rely on it must re-enable it explicitly. The batch also includes CVE-2026-115560 (input validation leading to RCE, file modification, session corruption or DoS), CVE-2026-129496 and CVE-2026-129481 (session-cleanup use-after-frees), CVE-2026-129289 (request-smuggling-style PHP code execution through persistent FastCGI backends such as nginx with fastcgi_keep_conn on, Apache mod_proxy_fcgi with enablereuse=on, HAProxy FastCGI or LSAPI), CVE-2026-129182 and CVE-2026-129474 (use-after-frees fixed only in 8.5.13/8.6.0), and CVE-2026-129291 (CVSS 8.8, an FPM local privilege escalation needing catch_workers_output and the epoll backend). The October 21 PHP2Shell releases do not contain the phpAfterShell fix, so servers patched then remain affected. Update to your branch’s fixed release, rebuild and redeploy container images, and confirm the web-serving PHP version; if you must wait, set session.upload_progress.enabled = 0 and limit attacker-controlled session data — the maintainers note disabling upload progress removes one input path but does not cover apps that store user data in sessions independently, and distro packages may carry the fix without changing the reported version number.
References:
- php-src security advisory GHSA-fm2m-fjf5-v3cp: Partially overwritten session files can lead to remote code execution (CVE-2026-126714)
- The Hacker News: PHP Fixes 7 Critical Flaws, Including Bugs That Could Allow Remote Code Execution
- The Hacker News: phpAfterShell Explained — How Hackers Could Turn a PHP Session Flaw Into Code Execution