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

PHP: use-after-free after interrupted session shutdown (CVE-2026-129481)

PHP Group PHP

Summary

The PHP session extension can retain a pointer to freed memory if a fatal error occurs during session shutdown. It affects PHP 8.3.x before 8.3.37, 8.4.x before 8.4.28 and 8.5.x before 8.5.13.

What happened

The session extension records the filename of the executing script when a session starts. If a fatal error occurs in an application callback while session variables are destroyed at shutdown, for example in stream_close() of a user-defined stream wrapper, the pointer is retained after the request memory is freed. A later request handled by the same worker can free the stale string. The weakness is classified as CWE-416 and CWE-459. The issue requires the filename to be allocated in request memory, for example when the script is not cached by OPcache.

Why it matters

According to the description, an attacker who can trigger such a failing cleanup may crash the worker or corrupt memory; code execution has not been demonstrated. The CVSS 4.0 score is 9.2 (critical severity, assigned by the PHP CNA), with vector CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N. The source does not state any active exploitation, and CISA's KEV catalog does not list it.

Affected products and versions

PHP (PHP Group): 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 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.3.37, 8.4.28 and 8.5.13 as the fixed versions, with release notes in the php.net changelog. The source does not state any other mitigations.

Fixed in: 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-416, CWE-459

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