CVE-2026-126714, a PHP session-file flaw rated 9.2 out of 10 on the CVSS 4.0 scale, lets an attacker craft session data that can be turned into active objects and, combined with a second vulnerability or a suitable gadget chain, can lead to code execution on the server.
What phpAfterShell is and which releases fix it
PHP's maintainers and the security firm Depthfirst describe the flaw as rooted in PHP's default file-based session handler and have named it phpAfterShell. Depthfirst says it discovered and reported the issue. The maintainers assigned it CVE-2026-126714 and rate it 9.2/10. Today's PHP releases include a fix; PHP 8.6.0, released alongside the patch, contains the correction.
The October 21 releases that addressed two critical PHP2Shell flaws do not include this fix, so servers updated then remain vulnerable until they install the newly released builds. The maintainers and Depthfirst report no observed attacks using phpAfterShell so far.
How a cut-off session write becomes an active object
Depthfirst's technical analysis shows the attack chain begins with a session write that upload progress performs before application code runs. PHP session files store values as a name followed by serialized data with length fields that tell PHP where strings end. Nothing in the format marks a write as completed.
If a worker process dies mid-write, a file can contain the beginning of the new data followed by the end of the old data. By crafting the lengths in the new data, an attacker can make text from the leftover old data parse as a separate record — including a serialized object. The next request to session_start() will load that record and instantiate the object. Depthfirst's public proof-of-concept used the harmless built-in stdClass to demonstrate object creation from a mixed session file.
The October 21 PHP2Shell emergency patches stopped the earlier exploit that activated objects during the upload-progress write by limiting which classes can be loaded at that moment, but they left the underlying write semantics unchanged. Object data still reaches disk and can become active later when a normal request opens the session.

Audit-ready is a season. It shouldn't be.
Evidence in spreadsheets, controls drifting between audits, frameworks multiplying on flat headcount. Nubivance runs continuous compliance on Rapid7 Cyber GRC - SOC 2, HIPAA, ISO 27001, PCI, CMMC.
End the scrambleWhich conditions make exploitation practical
Exploitation requires two things: a way to get attacker-controlled data into a file-based session that is written before application code runs (Depthfirst demonstrated this via PHP's upload progress feature), and a reliable method to stop the worker during the write so the file is left in the mixed state. The maintainers point to hard memory-limit failures in another thread of a threaded PHP build as one way a process can be killed mid-write.
In Depthfirst's Linux tests, the usual execution-timeout did not interrupt the write, so they used an out-of-memory kill to stop the worker. On their servers a planted object appeared on the 11th attempt in a fresh run — a figure the researchers say measures how often they needed to get the file into the required state, not the ultimate probability of achieving code execution. Depthfirst also notes that code execution still requires a gadget chain in the application unless a second bug is available; in their lab they chained to a memory-corruption bug in a built-in class and are withholding details for coordinated disclosure. They have not said whether that second bug is fixed in today's releases.
What the fixes change and interim mitigations
- The fixed releases empty the session file before each write and stop the write if that step fails. That prevents a cut-off write from leaving old data that an attacker could reuse, though a partial write can still lose session data.
- The updates also switch upload progress off by default in the released builds. The Hacker News compared the October 21 and today's source: the built-in setting was on in 8.2.35, 8.3.36, 8.4.27 and 8.5.12, and is off in 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. The release notes do not explain the change, and sample php.ini files still show the old setting in a commented line.
- Linux distribution packages may include the fix without changing the PHP version number, so version strings alone may not indicate whether a server is patched.
What this means for web operators, application developers, and hosting providers
Depthfirst and the maintainers give a clear remediation path: install the fixed release for the PHP branch in use (or move from end-of-life branches such as 8.1 and older to a supported branch), rebuild container images and redeploy, and verify that the PHP binary serving web requests is the updated one. If updating immediately is not possible and the application does not use upload progress, set session.upload_progress.enabled = 0 in php.ini or the server's PHP settings and restart PHP workers; but the maintainers stress this is not a full fix because other application behavior that writes attacker-controlled data into sessions can remain exploitable.
Moving sessions to a store that replaces records atomically (for example, some database-backed session handlers) also avoids the file-replacement issue, though installing the official fix remains the recommended action for sites that continue to use the files handler.
Depthfirst's discovery returns the spotlight to a subtle failure mode: a session write that appears ordinary on disk can, if interrupted, stitch old and new bytes into something the application later trusts. The recommended immediate step is straightforward — apply today's patched releases, rebuild and redeploy, and confirm the running PHP matches the patched build — even as researchers withhold details of related bugs pending coordinated disclosure.




