## Overview
CVE-2026-129481 is a critical use-after-free vulnerability affecting PHP Group PHP. The issue arises during session shutdown when a fatal error occurs in an application callback. This can lead to memory corruption or worker crashes.
## Technical Details
The PHP session extension records the filename of the executing script at the start of a session. If a fatal error occurs while destroying session variables, such as during the execution of `stream_close()` on a user-defined stream wrapper, the pointer to the filename is retained even after the request memory is freed. If a subsequent request is handled by the same worker, it may attempt to free this stale string, leading to potential crashes or memory corruption. The vulnerability is present in PHP versions 8.3.* before 8.3.37, 8.4.* before 8.4.28, and 8.5.* before 8.5.13.
## Impact
An attacker can exploit this vulnerability to crash the PHP worker or corrupt memory. While code execution has not been demonstrated, the potential for exploitation remains high, especially in environments where user-defined stream wrappers are used. This makes it critical for organizations to address the vulnerability promptly.
## Mitigation
Defenders should immediately update PHP to the latest versions: 8.3.37, 8.4.28, or 8.5.13 or later. Additionally, review application error handling to ensure that fatal errors during session shutdown are managed appropriately. Regularly monitor PHP security advisories for any further updates or related vulnerabilities.
CSURFACE Threat Sensor