Skip to content
DayZeroHub
Critical CVSS 9.2CVE-2026-126714

PHP: Partially overwritten session files can lead to remote code execution (CVE-2026-126714)

PHP Group PHP

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).

ProductVersionsFixed in
PHP Group PHP8.5.x before 8.5.138.5.13
PHP Group PHP8.4.x before 8.4.288.4.28
PHP Group PHP8.3.x before 8.3.378.3.37
PHP Group PHP8.2.x before 8.2.368.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

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-367, CWE-662

Relevant change history

  1. Advisory correction

    The preliminary version was replaced by the full write-up.

  2. Published

    Preliminary advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources