phpAfterShell CVE-2026-126714: A Half-Written PHP Session File Can Become Remote Code Execution
phpAfterShell (CVE-2026-126714, CVSS 4.0 9.2) is a flaw in PHP's default files session handler: an interrupted write leaves a session file that mixes new and old data, and PHP then deserializes it. It affects PHP 8.2 through 8.5, and the October PHP2Shell fixes do not cover it. Fixed in 8.2.36, 8.3.37, 8.4.28 and 8.5.13.
Executive summary. CVE-2026-126714, nicknamed phpAfterShell, is a critical flaw (CVSS 4.0: 9.2) in PHP's default file-based session handler. When PHP updates a session file it writes the new data over the old and truncates only if the new data is shorter. If that write is interrupted, the file ends up holding the start of the new data followed by the tail of the old, and PHP can then deserialize attacker-chosen objects from it. Remote code execution is not automatic: it needs a usable gadget chain in the application's own code or libraries, so real-world impact depends on what you run. It affects PHP 8.2 through 8.5; fixed in 8.2.36, 8.3.37, 8.4.28 and 8.5.13, released 19 November 2026, and disclosed by depthfirst. The detail that catches teams out: it bypasses the earlier PHP2Shell fix. The 21 October releases (8.2.35, 8.3.36, 8.4.27, 8.5.12) do not contain this patch. As of 19 November neither PHP nor depthfirst reported attacks, and it is not in CISA KEV. PHP 8.1 and older are end-of-life and get no fix.
What it is
| Field | Detail |
|---|---|
| CVE | CVE-2026-126714 ("phpAfterShell") |
| Component | PHP's default files session save handler |
| Weakness | Overwrite without guaranteed truncation, leading to mixed session content and unsafe deserialization |
| Severity | CVSS 4.0: 9.2 |
| Affected | PHP 8.2 to 8.5 |
| Fixed in | 8.2.36, 8.3.37, 8.4.28, 8.5.13 (19 Nov 2026) |
| Not fixed by | The October 21 releases (8.2.35, 8.3.36, 8.4.27, 8.5.12) |
| Status | No attacks reported by PHP or depthfirst as of 19 Nov; not in KEV |
| End of life | 8.1 and older receive no patch |
How it works
PHP updates a session file (default "files" handler)
│ new data written over old; truncated only if shorter
▼
Write is interrupted (for example by a crafted upload-progress request)
│
▼
File now = start of new data + tail of old data
│
▼
Next request unserialize()s the mixed content
│ attacker-influenced bytes reach the deserializer
▼
A gadget chain in your app or libraries turns that into code executionThis is a file-corruption primitive that feeds a deserialization bug. The corruption alone does nothing; the gadget chain does the harm, and large PHP applications and Composer dependency trees often contain chains that public tooling already knows about. That is why the severity score is high even though exploitation is conditional. One stopgap reported by Cycode, setting session.upload_progress.enabled = 0, closes only one way to interrupt the write, not the underlying flaw.
Why it needs industry attention
PHP still powers a huge share of the web, and file-based sessions are the default on most hosts and distributions. The follow-on to PHP2Shell is also a lesson in incomplete fixes: servers that patched promptly in October believed they were current, and are not. Add the end-of-life problem, since 8.1 and older will never be patched, and you have a long tail of exposed sites. For the earlier PHP2Shell context see our coverage of the Cisco Expressway flaw and the mid-November digest.
What to do
- Upgrade PHP to 8.2.36, 8.3.37, 8.4.28 or 8.5.13 (or later) and restart PHP-FPM or Apache.
- On Debian and Ubuntu, do not trust the version string. Distributions backport security fixes without changing the upstream number. Check the package changelog instead:
php -v
apt changelog php8.3-cli | grep -i 126714 # adjust the package name for your version- If you cannot upgrade immediately: disable upload-progress tracking (
session.upload_progress.enabled = 0) as a partial stopgap, and consider a non-file session handler (such as Redis or a database) so the vulnerable code path is not used. Test that change, since it affects session behaviour. - Shrink the gadget surface: run
composer audit, update frameworks and libraries, remove unused dependencies, and never callunserialize()on untrusted data in your own code (preferjson_decode). - Plan off end-of-life PHP. Anything on 8.1 or older needs migrating; there is no patch coming.
- Isolate sessions: make sure
session.save_pathis private to each application and not world-readable.
How to detect it
- Session files with garbled or oversized content in
session.save_path(for example/var/lib/php/sessions): asess_*file whose serialized data ends in leftover fragments. - Unusual multipart upload requests carrying the upload-progress field (
PHP_SESSION_UPLOAD_PROGRESSby default), often in bursts against a single session ID; this is visible in a WAF or request-body logging, not in default access logs. - PHP errors about unserialize or unexpected object classes in application logs.
- Web server user spawning shells or making unexpected outbound connections, the usual sign a deserialization chain fired.
Conclusion
phpAfterShell is conditional in exploitation but broad in exposure, and it undoes the comfort of having patched in October. Move to a fixed PHP release, verify by changelog on distribution packages, trim your dependency tree of gadget material, and retire PHP versions that no longer receive fixes.
Do this now: upgrade to 8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 (or confirm your distro's backport by changelog), set upload-progress off as a stopgap, run composer audit, and list any hosts still on PHP 8.1 or older.
Related: our state of exploitation report and the Learn track on web application pentesting.
Sources: Wiz, Cycode, SOC Prime, IONIX, Astra Security. Sources differ on whether PHP 8.6.0 is also a fixed version; the PHP advisory lists the four versions above.
Related research
Azure API Management Classic Flaw Exploited to Steal Secrets, With Norwegian Energy Firms Targeted
Microsoft mitigated an actively exploited flaw in Azure API Management Classic tiers (Developer, Basic, Standard, Premium) that allowed unauthorized access to management functions and stored secrets. Norwegian authorities linked the activity to attacks on energy companies. The fix does not invalidate credentials that were already stolen, so rotation is on you.
REDCap CVE-2026-90817: A Public Survey Link Is All It Takes to Reach the Server
REDCap runs clinical research data capture at thousands of universities and hospitals. CVE-2026-90817 is a CVSS 9.8 unauthenticated remote code execution flaw: a crafted request, using a public survey hash that invitation emails routinely expose, reaches an unintended route and then a data-import path. It is on CISA KEV and a public PoC exists. Upgrade to 16.0.49 LTS, 17.3.10 LTS or 17.4.4.
F5 BIG-IP: Six Critical Stack Overflows, Hotfixes Only, and the Edge Device Everyone Depends On
On 18 November F5 published six critical stack-based buffer overflow advisories for BIG-IP, rated CVSS 9.8 (v3.1) and 9.3 (v4.0). An unauthenticated remote attacker can crash the Traffic Management Microkernel, and F5 says remote code execution may be possible. No exploitation is reported, but only engineering hotfixes exist, with no workaround or scheduled release fix yet.