Summary
PHP's default files session save handler can, if a write is interrupted, leave mixed session data that allows object injection. The vendor fixed it in PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13.
What happened
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. According to the source, 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 if the application contains a suitable gadget chain. Session data can also be corrupted. The source associates the issue with CWE-367 and CWE-662.
Why it matters
The source rates the vulnerability as critical, with a CVSS 4.0 score of 9.2 (vector CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N, assigned by CNA:php). The described impact includes remote code execution, which depends on the application containing a suitable gadget chain, as well as session data corruption. The source does not state active exploitation. Vendor references: GHSA-fm2m-fjf5-v3cp and the PHP release notes.
Affected products and versions
PHP (PHP Group): versions before 8.2.36; 8.3.x before 8.3.37 (>= 8.3.0, < 8.3.37); 8.4.x before 8.4.28 (>= 8.4.0, < 8.4.28); 8.5.x before 8.5.13 (>= 8.5.0, < 8.5.13).
| Product | Versions | Fixed in |
|---|---|---|
| PHP Group PHP | 8.5.x before 8.5.13 | 8.5.13 |
| PHP Group PHP | 8.4.x before 8.4.28 | 8.4.28 |
| PHP Group PHP | 8.3.x before 8.3.37 | 8.3.37 |
| PHP Group PHP | 8.2.x before 8.2.36 | 8.2.36 |
| PHP Group PHP | < 8.2.36 | — |
| PHP Group PHP | >= 8.3.0, < 8.3.37 | — |
| PHP Group PHP | >= 8.4.0, < 8.4.28 | — |
| PHP Group PHP | >= 8.5.0, < 8.5.13 | — |
Action recommended by the source
The vendor lists PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13 as the fixed versions in its release notes (PHP 8 ChangeLog). The source does not mention other mitigations.
Fixed in: 8.2.36, 8.3.37, 8.4.28, 8.5.13
Sources and references
- https://www.php.net/ChangeLog-8.php#8.5.13 — PHP
- https://www.php.net/ChangeLog-8.php#8.4.28 — PHP
- https://www.php.net/ChangeLog-8.php#8.3.37 — PHP
- https://www.php.net/ChangeLog-8.php#8.2.36 — PHP
- https://github.com/php/php-src/security/advisories/GHSA-fm2m-fjf5-v3cp — CVE Program
- https://access.redhat.com/security/cve/cve-2026-126714 — NVD
- https://bugzilla.suse.com/show_bug.cgi?id=1290690 — NVD
- https://depthfirst.com/phpaftershell — NVD
- https://github.com/semgrep/detection-scripts/pull/14 — NVD
- https://ubuntu.com/security/CVE-2026-126714 — NVD
Weaknesses (CWE): CWE-367, CWE-662
Relevant change history
Advisory correction
The preliminary version was replaced by the full write-up.
Published
Preliminary advisory published.