PHP · CVE-2026-126714
phpAfterShell
Patch now if…Needs a crashed session write and a gadget. Fixed 19 Nov.
PHP's default file-based session storage can leave a half-old, half-new session file if a write is cut short, and an attacker can use that to make PHP rebuild objects of their choice and run code. It also needs the attacker's data in the session, a worker killed mid-write and a suitable code library in the app; lab exploit code is public, no attacks are reported, and the 19 Nov 2026 releases fix it. It's a separate bug from PHP2Shell, not a bypass: the October releases just don't include this fix.
How scary is it?
Are you affected? only if all are true
1PHP older than the 19 Nov 2026 fixcommand
PHP 8.2 to 8.5 below 8.5.13, 8.4.28, 8.3.37 or 8.2.36. PHP 8.6.0 (19 Nov) is fixed. The October PHP2Shell releases don't fix it. PHP says the code dates back to PHP 4.1.0, so older, unsupported PHP is affected too. Distros may backport the fix without changing the version number.1,2,3
php -v2Sessions are stored in filescommand
The files save handler is PHP's default. Sessions in Redis, a database or another store that replaces a record in one step aren't hit by this bug. The CLI can read a different php.ini than PHP-FPM or Apache.1,3
php -i | grep session.save_handler3Attackers can fill the sessioncommand
They need to put a lot of their own data into a session. Session upload progress does that for anyone who sends a file upload, and it was on by default until the 19 Nov releases (see PHP session RCE). An app that stores large user input in the session works too, even with upload progress off. Whether a login is needed depends on the app.1,3,4
php -i | grep session.upload_progress.enabled4The write can be cut short
The PHP worker has to die partway through saving the session. PHP's advisory describes a memory-limit crash in another thread on threaded PHP builds; Wiz says memory limits or timeouts can do it. One public lab does it over plain HTTP by pushing a memory-limited container into an out-of-memory kill.1,5,6
5The app has a usable library
Running code needs a suitable "gadget chain" in the app, which isn't in every app. Both public labs plant their own gadget class. Without one, the bug can still corrupt sessions.1,5,6,7
What to do
1Update PHP and restart
Update to 8.6.0, 8.5.13, 8.4.28, 8.3.37 or 8.2.36 (19 Nov 2026), then restart every PHP worker. The fix empties the session file before writing, so a cut-short write can lose a session but can't mix two. Debian has fixed packages (DSA-6641-1, DLA-4916-1). The same releases fix our other PHP pages, PHP session RCE and PHP-FPM smuggling.1,2,8
Latest safe versions checked 21 Nov
2Can't update? Turn off upload progresscommand
Set it in php.ini, the FPM pool or server config, then restart. PHP says this removes the easiest way in, not the bug: apps that store user input in sessions stay exposed. Keep untrusted data in sessions small.1,3
session.upload_progress.enabled = 03Optional: a different session store
PHP says a store that replaces records in one step avoids this bug; depthfirst names Redis and databases. Updating PHP is still the recommended fix for the default files handler.1,3
This page shows you how to check. It can't tell you you're safe.
Sources (11) and changelog
- PHP GHSA-fm2m: full advisory, conditions, fix and mitigation 19 Nov
- PHP: 8.x ChangeLog, 19 Nov 2026 releases 19 Nov
- depthfirst: the finder's write-up, separate flaw from PHP2Shell, other session stores 19 Nov
- PHP GHSA-658j: upload progress off by default from the 19 Nov releases 19 Nov
- Wiz: memory limits or timeouts, gadget chain needed, no exploitation seen
- Public lab exploit: out-of-memory kill over HTTP, planted gadget 20 Nov
- Public practice lab: killed worker, planted gadget chain 20 Nov
- Debian tracker: DSA-6641-1, DLA-4916-1
- Cycode: no attacks reported by PHP or the finder
- CISA KEV catalog: not listed
- CVE record: CVE-2026-126714 (CVSS 4.0 9.2)
- Published.