PHP fixes seven critical flaws that allowed remote code execution

- Reading
- 5 min
- Tables
- 1
The PHP Foundation released patches for eight vulnerabilities, seven of them rated critical, including one that turns an interrupted session write into remote code execution.
Eight CVEs, seven of them critical
On November 19, 2026, the PHP Foundation released security updates for all actively supported versions of the language, fixing eight vulnerabilities. Seven of them received a CVSS score of 9.2, in the critical range; the eighth came in at 8.8, rated high severity. The release follows an earlier advisory from the maintainers, which had already flagged multiple serious flaws in non-default configurations or unusual setups, according to a report from The Hacker News.
The fixed versions are PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, and the newly released 8.6.0. Anyone running a production application on any of these branches needs to update: the set of flaws ranges from unauthenticated remote code execution to local privilege escalation, including memory corruption and denial of service.
phpAfterShell: from an interrupted write to full RCE
The most thoroughly documented vulnerability in the batch is CVE-2026-126714, dubbed "phpAfterShell" by research firm Depthfirst. It's a Time-of-check Time-of-use (TOCTOU) flaw in PHP's session handling, and the path to code execution is direct, though it requires chaining.
If a pwrite()/ftruncate() update is interrupted, PHP may leave behind a malformed session file that is later loaded by session_start(), yielding an arbitrary deserialization primitive.
Depthfirst, security research team
Depthfirst explains that, chained with another of its own findings involving native PHP deserialization leading to RCE, the flaw allows full remote code execution. The mechanism depends on the PHP worker dying at a bad moment: during the session file write, or after the write but before removing the previous session's content.
Researcher Yuhang Wu, from the same team, described the practical outcome:
Depending on where the interruption happens, part of the new Session may already have been written while bytes from the previous Session remain on disk. The result can be a Session file containing the prefix of the new serialized data and the tail of the old one.
Yuhang Wu, security researcher at Depthfirst
By carefully choosing the length fields in the new prefix, an attacker can make PHP's session decoder interpret leftover bytes, previously just part of an ordinary string, as separate session entries and serialized objects. Nothing needs to be deserialized during the upload-progress callback itself: it's enough to leave the right bytes on disk and wait for the application to call session_start(). The flaw affects any application running a vulnerable version with file-based sessions, the default model for most PHP installations. Until the patch is deployed in production, the recommended mitigation is to disable session upload-progress.
The infrastructure bug that goes unnoticed: CVE-2026-129289
Another flaw on the list deserves extra attention from anyone operating a production stack because it doesn't depend on user interaction or on a non-default application configuration: CVE-2026-129289, an inconsistent interpretation of HTTP requests.
The problem shows up when the front end keeps persistent connections to the PHP back end and the application opens php://input without reading it in full. This is common in setups such as:
- Nginx with
fastcgi_keep_connenabled - Apache
mod_proxy_fcgiwithenablereuse=on - FastCGI applications behind HAProxy that keep the connection to the backend alive
- LSAPI
Under these conditions, an attacker may be able to execute PHP code they control as if they were the worker itself, without needing another user to interact and without relying on a non-default PHP configuration: the problem lies in the combination with the reverse proxy. Teams that use fastcgi_keep_conn or enablereuse to gain performance under high concurrency are exactly the audience that needs to review this configuration along with the patch.
The full picture of the fixes
| CVE | CVSS | Type | Fixed in |
|---|---|---|---|
| CVE-2026-115560 | 9.2 | Input validation, RCE/session corruption | 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0 |
| CVE-2026-126714 (phpAfterShell) | 9.2 | Session TOCTOU, RCE | 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0 |
| CVE-2026-129289 | 9.2 | Inconsistent HTTP interpretation, RCE | 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0 |
| CVE-2026-129496 | 9.2 | Use-after-free, unauthenticated RCE | 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0 |
| CVE-2026-129182 | 9.2 | Use-after-free, memory corruption | 8.5.13, 8.6.0 |
| CVE-2026-129474 | 9.2 | Use-after-free, RCE (PHP 8.5+) | 8.5.13, 8.6.0 |
| CVE-2026-129481 | 9.2 | Use-after-free, session cleanup failure | 8.3.37, 8.4.28, 8.5.13, 8.6.0 |
| CVE-2026-129291 | 8.8 | Use-after-free, local privilege escalation | 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0 |
CVE-2026-129291 is the only one outside the critical range and requires a more specific scenario: local code execution within an FPM worker, a pool with catch_workers_output enabled, the epoll event backend, and the ability to manipulate the workers' lifecycle. It's a post-exploitation vector, useful for someone who already has some access to the server, not a remote entry point.
What changes for those running PHP in Brazil
The practical lesson isn't just "update PHP." Many of the flaws in this round depend on specific infrastructure combinations, such as fastcgi_keep_conn in Nginx, enablereuse in mod_proxy_fcgi, or file-based sessions without upload-progress mitigation. Here's the checklist:
- Update to
8.2.36,8.3.37,8.4.28, or8.5.13, depending on the branch used in production - Review reverse proxy configurations that keep persistent connections to the PHP backend
- If an immediate update isn't possible, disable session upload-progress as a temporary mitigation against phpAfterShell
- Map applications with known deserialization gadget chains, since several of these flaws rely on chaining with this type of vector
The source doesn't specify whether there's active mass exploitation of any of these CVEs as of publication, nor does it list CVEs already attributed to specific attack campaigns. What's clear is that the set of flaws hits fairly common configurations, shared hosting and deployments behind a keep-alive reverse proxy, a recurring scenario in legacy PHP stacks that still power a large share of production applications in the country.
Translated from the Brazilian Portuguese original · Read the original
PHP 8.6 Arrives with Partial Function Application, Duration, and a Polling API for I/O
Released this Thursday (11/19), the major PHP version brings partial functions, a class for measuring time, scalable I/O with epoll/kqueue, and stricter security by default.





