CVE-2026-126714: PHP · Remote code execution
Exploitation: Public exploit · CVSS 9.2 Critical · Unauthenticated · Published 2026-11-19
Description
Partially overwritten session files can lead to remote code execution. The files session save handler, which is the default, writes updated session data into the existing session file without first clearing it. If a write is interrupted, the file can contain the beginning of the new session followed by the end of the old one, and bytes of an ordinary string can later be unserialized as objects. An attacker who can influence the session data, for example through session upload progress, and interrupt a write at a suitable point may inject objects, which can lead to code execution when the application contains a suitable gadget chain. Session data can also be corrupted. This issue affects PHP versions before 8.2.36, 8.3.* before 8.3.37, 8.4.* before 8.4.28 and 8.5.* before 8.5.13.
Enclave's analysis
PHP's default file-based session handler rewrites session files in place, so a worker killed mid-write can leave a spliced file whose tail gets unserialized as attacker-controlled objects on the next request. An attacker who can put data into a session, classically via upload-progress fields in a multipart POST, and time an interruption just right can inject PHP objects. A research firm has already demonstrated a full HTTP-only exploit reaching code execution, but the exact technique that completes RCE wasn't published. It needs the files session handler and a way to influence and interrupt writes, and turning it into a reliable hit takes many calibrated attempts, not one shot. Upgrade to the patched PHP release.
Fix
Upgrade PHP to 8.2.36 or 8.3.37 or 8.4.28 or 8.5.13; PHP (ext-session, files save handler) to 8.2.36 or 8.3.37 or 8.4.28 or 8.5.13.
Affected versions
| Product | Vulnerable | Fixed in |
|---|---|---|
| PHP | 0 before 8.2.36 | 8.2.36 |
| PHP | 8.3.0 before 8.3.37 | 8.3.37 |
| PHP | 8.4.0 before 8.4.28 | 8.4.28 |
| PHP | 8.5.0 before 8.5.13 | 8.5.13 |
| PHP (ext-session, files save handler) | >=8.2.0,<8.2.36 | 8.2.36 |
| PHP (ext-session, files save handler) | >=8.3.0,<8.3.37 | 8.3.37 |
| PHP (ext-session, files save handler) | >=8.4.0,<8.4.28 | 8.4.28 |
| PHP (ext-session, files save handler) | >=8.5.0,<8.5.13 | 8.5.13 |