VulnWatch by ve1ve2
critical 9.2 KEVEXPLOITEPSS 100.0%

GHSA-g3vh-838c-65v7 / CVE-2026-129481: Use-after-free after interrupted session shutdown

Source:
PHP releases (GitHub php/php-src tags)
Published:
Fetched:
Updated:
Affects:
php ext-session
KEV due:
2026-10-29

https://github.com/php/php-src/security/advisories/GHSA-g3vh-838c-65v7 ↗

repo-advisoryphpCWE-416CWE-459securityrepo:php/php-src

Use-after-free after interrupted session shutdown ### Summary PHP can retain a pointer to a script filename after session shutdown is interrupted and the request memory has been released. A later request handled by the same worker can then release the stale string, causing a heap use-after-free. This is an incomplete fix for CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp). It affects PHP 8.3 and later. PHP 8.2 does not contain the affected session filename field. ### Details When a session starts, PHP records the executing script's filename in an internal global variable. Session shutdown normally releases this string, but it destroys the session variables first. That destruction can invoke application callbacks, including a user-defined stream wrapper's `stream_close()` method. A fatal error in such a callback can abort session shutdown before the filename is released or cleared. PHP catches the bailout and continues shutting down the request. The request heap is then freed while the worker still retains the filename pointer. The next request's session initialization does not reset this field. Starting another session can release the stale string, and ordinary session-module shutdown can also reach it even when the next script does not call any session functions. The requests must reach the same worker, but they do not need to belong to the same user or session. The reported reproducer uses PHP-FPM with OPcache disabled and a stream resource held in the session. Its close callback raises a fatal error during cleanup. A subsequent request then reaches the freed filename. The report confirms the use-after-free on PHP 8.4.27 and 8.5.12. PHP 8.3.36 contains the same vulnerable code. Unlike the early-error and upload-progress cases in the original advisory, this path does not require a diagnostic-producing FastCGI parameter or session upload progress. ### Impact An attacker who can cause an application's session cleanup to fail in this way may corrupt memory or crash a reused PHP worker. The use-after-free could potentially lead to remote code execution, but code execution through this specific field has not been demonstrated. Authentication requirements depend on the application path that reaches the failing cleanup. The demonstrated configuration has OPcache disabled, so the recorded filename belongs to the request heap. A filename retained in persistent OPcache memory does not produce the same dangling pointer. Exploitability depends on how the affected script was loaded and whether its filename is request-owned. ### Affected versions The affected field was introduced in PHP 8.3.0, when `session_start()` began recording the file and line where a session was started in order to report them in the notice about an already active session. PHP 8.2 and earlier do not contain the field and are not affected. ### Mitigation Upgrade to the fixed release for your PHP branch when it becomes available. The fix clears the recorded session filename and line number during sessi Affected packages: php:ext-session Patched: ext-session 8.3.37, ext-session 8.4.28, ext-session 8.5.13

Linked vulnerabilities (4)

CVE-2026-109619 critical 9.2 KEVEPSS 100.0% (p100) NVDCVE.orgGHSAGHSA
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

PHP has various global state that temporarily points into request memory. In some scenarios, global state may not be correctly reset, or may be repopulated after being reset. The global state may then refer to request memory even after it has been freed. Subsequent requests may read or branch on this stale state before it is fully initialized. Multiple strategies can trigger this condition and produce remote code execution (RCE).

CWE: CWE-416, CWE-755, CWE-824, CWE-1325, CWE-1419KEV added 2026-10-26, due 2026-10-29Aliases: CVE-2026-109618, GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rpNVD: Analyzed
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

RCE via stale global state

CWE: CWE-416, CWE-755, CWE-824, CWE-1325, CWE-1419Aliases: CVE-2026-109618, CVE-2026-109619, GHSA-w8hw-w9fx-j79w
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

Use-after-free after interrupted session shutdown

CWE: CWE-416, CWE-459Aliases: CVE-2026-129481, CVE-2026-109619, GHSA-6wmf-4rv5-p3rp
CVE-2026-129481 critical 9.2 EPSS 3.47% (p89) NVDCVE.orgGHSAGHSA
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Use-after-free after interrupted session shutdown

CWE: CWE-416, CWE-459, CWE-825Aliases: GHSA-g3vh-838c-65v7, CVE-2026-109619, GHSA-6wmf-4rv5-p3rp, CVE-2026-115560, CVE-2026-126714, CVE-2026-127960, CVE-2026-128064, CVE-2026-128090, CVE-2026-129289, CVE-2026-129291, CVE-2026-129292, CVE-2026-129496, CVE-2026-129501, CVE-2026-129506, CVE-2026-129538, CVE-2026-15353NVD: Awaiting Analysis

Also reported by (2)