phpAfterShell (CVE-2026-126714) Slips Past PHP2Shell Patch
PHP fixed phpAfterShell (CVE-2026-126714), a critical session flaw that slips past the October PHP2Shell fix, on November 19, 2026. The same release fixes six other critical PHP bugs, which makes this a priority update for any PHP estate.
What Is CVE-2026-126714?
CVE-2026-126714 (CVSS 9.2), known as phpAfterShell, is a critical flaw in PHP’s default file-based session handler that can leave a session file half old and half new, and in some applications turn that corruption into Remote Code Execution (RCE). It reaches the same dangerous state as last month’s PHP2Shell flaws through a path the October fix left open. PHP rates the flaw 9.2 under CVSS v4.0 and fixed it in PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13; the full exploit chain has not been published.

Why Did the PHP2Shell Patch Leave a Path Open?
PHP2Shell (CVE-2026-109618 and CVE-2026-109619) forced emergency PHP releases on October 21, 2026. CISA added both CVEs to its KEV catalog on October 26, and attackers have since used PHP2Shell against network gateways.
The October fix blocked object creation inside the file upload progress callback. How PHP saves the session file to disk stayed the same. Depthfirst, which named the flaw phpAfterShell, explains in its analysis that the October patch shut down the known exploit path but left the session file write itself unsafe if a PHP worker crashes mid-update. phpAfterShell does not need anything to happen inside that callback, because the corrupted file is only read back later through a normal session_start() call.
What Goes Wrong Inside the Files Session Handler?
Under the default files handler, every session lives on disk as a single serialized string. PHP’s advisory traces the bug to ps_files_write(), which reuses the existing session file and overwrites it from the start instead of emptying it before the new data goes in. In practice, the handler calls pwrite() at offset zero and trims leftover bytes with ftruncate() only afterward.
Because these are two separate system calls, a worker that dies between them, or in the middle of the write, leaves a mixed file: fresh session data at the top and stale bytes from the earlier session below it. Locking the file does not prevent this. Nothing in a session file records its expected size or confirms that a write finished, so PHP reads the mixed content as if it were valid.
An attacker who controls the new data can arrange it so the stale remainder is parsed as serialized objects, which PHP then instantiates on the next session_start() for that session ID. PHP maps the bug to CWE-367 and CWE-662 and, from reviewing the code, believes it has existed since PHP 4.1.0.
Which Conditions Does an Attack Need?
- Default session storage: PHP’s built-in files save handler, active unless another backend is configured; session stores that swap a whole record in a single operation avoid this defect
- Control over session data: Upload progress tracking (session.upload_progress.enabled) offers one route, though PHP notes that other routes can also work
- An interrupted write: The PHP process has to stop mid-write; the researchers forced out-of-memory kills in their tests, and PHP says a hard memory-limit failure in a separate thread of a threaded build can have the same effect
- A later session load: A subsequent request must call session_start() on the damaged session
- A path from objects to code: Usually a deserialization gadget chain, although that requirement is disputed
Those preconditions are why the CVSS v4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N) marks attack requirements as present. PHP’s pre-release notice also said its critical issues require “either non-default configuration or uncommon setups.” Authentication requirements vary with how each application handles sessions.
Does Exploitation Depend on an Application Gadget Chain?
PHP and the researchers disagree on this point. PHP’s advisory says code execution requires “an application with a suitable deserialization gadget chain.” The researchers counter that their complete chain uses no application classes at all, relying instead on a memory corruption bug in a class built into PHP.
Because the decoder and heap layout behind that chain are still private under coordinated disclosure, nobody outside the team can confirm it yet. The safer assumption is the researchers’ version: an application with no known gadgets does not justify postponing the update.
Affected and Fixed PHP Versions
| Branch | Vulnerable | Fixed In |
|---|---|---|
| PHP 8.2 | Before 8.2.36 | 8.2.36 |
| PHP 8.3 | 8.3.0 to 8.3.36 | 8.3.37 |
| PHP 8.4 | 8.4.0 to 8.4.27 | 8.4.28 |
| PHP 8.5 | 8.5.0 to 8.5.12 | 8.5.13 |
| PHP 8.6 | Pre-release builds | 8.6.0 (released November 19 with the same security fixes) |
PHP’s advisory covers only the four supported branches, so systems on older releases should move to a supported version or confirm fixes with their distribution. Distribution packages often carry backported patches under older version strings, which makes the vendor’s security tracker a better guide than the version number.
Six More Critical Fixes Ship in the Same Release
The November 19 releases carry seven advisories rated critical at CVSS v4.0 9.2, including phpAfterShell. The other six are listed below:
| CVE | Component | Issue | Fixed Branches |
|---|---|---|---|
| CVE-2026-115560 | Session | Session serializer mismatch with upload progress can lead to RCE | 8.2, 8.3, 8.4, 8.5 |
| CVE-2026-129289 | PHP-FPM | Request smuggling when php://input is left unread on reused backend connections | 8.2, 8.3, 8.4, 8.5 |
| CVE-2026-129496 | Date | Use-after-free in the timezone cache | 8.2, 8.3, 8.4, 8.5 |
| CVE-2026-129481 | Session | Use-after-free after an interrupted session shutdown | 8.3, 8.4, 8.5 |
| CVE-2026-129474 | Core | Use-after-free in fatal-error backtraces involving __call and __callStatic | 8.5 |
| CVE-2026-129182 | Core | Use-after-free in a fatal-error backtrace global | 8.5 |
PHP first disclosed CVE-2026-115560 in October without technical details and told administrators to keep upload progress disabled until the next scheduled release. The changelog also lists lower-rated fixes in CGI, DOM, PHP-FPM (including CVE-2026-129291), Phar, SOAP, the standard library and the URI extension, which moves to uriparser 1.0.3 for CVE-2026-48841.
Has phpAfterShell Been Exploited?
As of November 19, 2026, neither the PHP maintainers nor the researchers had reported attacks using phpAfterShell, and CVE-2026-126714 was not in CISA’s KEV catalog. The published proof of concept (PoC) only writes a harmless stdClass object into a session file; the full chain appears only in a demonstration video, and the working exploit details remain private.
That could change fast. Exploitation attempts against PHP2Shell started on October 17, before a patch was available, and phpAfterShell hits the same session code with its root cause already public. SOCRadar assesses that the latest releases warrant urgent patching.
What Should PHP Administrators Do Now?
- Update every runtime: Move to 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0, then restart PHP-FPM or Apache workers and rebuild container images
- Verify what actually serves requests: The CLI version can differ from the FPM or module version handling web traffic
- Disable upload progress if you cannot update: Set session.upload_progress.enabled = 0 in php.ini or the FPM pool configuration and restart workers; PHP’s earlier guidance warns against relying on ini_set() or .user.ini for this setting
- Reduce what sessions hold: Keep untrusted input out of sessions where possible, or switch to a session backend that writes each record in a single atomic operation, as PHP suggests
- Keep upload progress off unless needed: After updating, enable it only for applications that use it
For hunting, PHP has published no indicators. Reasonable hypotheses include PHP worker processes killed by the out-of-memory killer or hitting hard memory limits while handling multipart uploads, bursts of multipart POST requests carrying upload progress fields against the same session ID, and session files that contain unexpected serialized object strings. A quiet log does not rule out compromise, since a successful attack can look like an ordinary worker crash followed by a normal request.
How SOCRadar Can Help
SOCRadar helps teams follow phpAfterShell and the related PHP session flaws, and act on their own exposure:
- Vulnerability Intelligence: Follows CVE-2026-126714, CVE-2026-115560 and the other November PHP fixes as exploitation reports, proof-of-concept releases and distribution patches emerge, as part of the Cyber Threat Intelligence module
- Autonomous Exposure Management: Finds internet-facing web servers and applications that reveal their PHP version, so teams know which hosts still run pre-November builds
- Advanced Dark Web Monitoring: Surfaces exploit sales, chain releases and attacker chatter about phpAfterShell and PHP2Shell across criminal forums, marketplaces and encrypted chat channels

Exploitation status and distribution fixes for phpAfterShell are still changing, and SOCRadar keeps that picture current so teams can respond as soon as the risk shifts.

