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.
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 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 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.
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.
Upgrade to the fixed release for your PHP branch when it becomes available. The fix clears the recorded session filename and line number during session initialization. It also terminates the PHP process if a module's request-shutdown handler bails out, preventing the process from handling another request with only partially cleaned-up state.
Until the update is available, avoid fatal errors in callbacks reached during session cleanup. For PHP-FPM, setting pm.max_requests=1 and restarting the workers prevents the demonstrated sequence from reaching a second request in the same worker, at a performance cost.
Disabling session upload progress does not address this path. Enabling OPcache alone is not a reliable mitigation because scripts can still execute without being cached.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
