VulnWatch by ve1ve2
critical 9.2 KEVEXPLOITEPSS 100.0%

GHSA-2fjv-p558-g82m / CVE-2026-129182: Use-after-free via repopulation of last_fatal_error_backtrace global after shutdown

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

https://github.com/php/php-src/security/advisories/GHSA-2fjv-p558-g82m ↗

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

Use-after-free via repopulation of last_fatal_error_backtrace global after shutdown ### Summary As part of CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp), PHP 8.5.12 fixes a generic use-after-free of the `last_fatal_error_backtrace` global by clearing it during executor shutdown. Further scenarios have been discovered in which a fatal diagnostic during later shutdown work repopulates the global. The request heap is then released, and an early diagnostic in a subsequent request handled by the same worker can access the stale backtrace before normal executor initialization. ### Details The backtrace can be recreated while PHP restores modified INI settings after executor cleanup: - When `max_memory_limit` is specified in both the global and a path-specific configuration, restoring the global limit can fail if memory consumption still exceeds that limit. The resulting fatal error recreates the backtrace. - When the global configuration specifies `zlib.output_compression=1`, and a path-specific configuration specifies `zlib.output_compression=0` and `output_handler=ob_gzhandler` (or another handler), restoring compression before restoring `output_handler` can raise a fatal configuration error because the two settings conflict. Both shutdown cases are possible with PHP-FPM and mod_php. The `max_memory_limit` override requires administrative configuration. `.user.ini` can supply the zlib settings but cannot change `max_memory_limit`. Exploitation also requires a diagnostic before executor initialization in a later request handled by the same worker. Apache per-directory configuration can provide this. FPM is conditionally exposed when the frontend sends a diagnostic-producing `PHP_VALUE` or `PHP_ADMIN_VALUE` FastCGI parameter. Ordinary FPM pool settings and `.user.ini` do not provide this early diagnostic. The fix is generic: PHP no longer creates or consumes the fatal-error backtrace while the executor is inactive. This also covers other shutdown diagnostics that might recreate the same state. ### Impact Successful exploitation can result in memory corruption and potentially full remote code execution (RCE), as in CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp). The two restoration cases demonstrate heap use-after-free and worker crashes. RCE through these specific entry points has not been demonstrated. ### Affected versions The affected global was introduced in PHP 8.5.0 by fatal error backtraces. The fix for CVE-2026-109619 in PHP 8.5.12 cleared it during executor shutdown but did not stop later shutdown work from setting it again, so every PHP 8.5 release before 8.5.13 is affected. PHP 8.4 and earlier do not contain the global and are not affected. ### Mitigation Upgrade to PHP 8.5.13 when it becomes available. As a temporary workaround, disable fatal-error backtraces administratively with `fatal_error_backtraces=0` and restart all workers. Ensure that request-specific configuration cannot re-enable the setting. Affected packages: php:engine Patched: engine 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:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Use-after-free via repopulation of last_fatal_error_backtrace global after shutdown

CWE: CWE-416, CWE-459Aliases: CVE-2026-129182, CVE-2026-109619, GHSA-6wmf-4rv5-p3rp, CVE-2026-129538, CVE-2026-129474, GHSA-5j3f-64r7-f564, GHSA-8mjj-2r7p-4hg2
CVE-2026-129182 critical 9.2 EPSS 8.49% (p95) NVDCVE.orgGHSAGHSA
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/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 via repopulation of last_fatal_error_backtrace global after shutdown

CWE: CWE-416, CWE-459, CWE-825Aliases: GHSA-2fjv-p558-g82m, CVE-2026-109619, GHSA-6wmf-4rv5-p3rpNVD: Awaiting Analysis