Use-after-free via repopulation of last_fatal_error_backtrace global after shutdown
A public exploit exists; no exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 8%. Fixed in PHP 8.5.13.
Use-after-free via repopulation of last_fatal_error_backtrace global after shutdown. A fatal error raised while modified INI settings are restored during request shutdown can repopulate the stored fatal error backtrace after the executor has been cleaned up. The request memory is then freed, and a diagnostic emitted before executor initialization in a later request handled by the same PHP-FPM or mod_php worker can access the stale backtrace. The shutdown error requires per-path configuration of max_memory_limit, or of zlib.output_compression together with output_handler (which .user.ini can also set). The early diagnostic requires Apache per-directory configuration or, for PHP-FPM, a PHP_VALUE or PHP_ADMIN_VALUE parameter sent by the front end. This can cause memory corruption and worker crashes, and may allow remote code execution. This issue affects PHP versions 8.5.* before 8.5.13.
Briefing
Written from the sources below · deepseek-v4.1-flash
A use-after-free in PHP's fatal-error backtrace handling: an error during request shutdown can repopulate the global after executor cleanup, and a later request on the same PHP-FPM or mod_php worker may read the stale pointer. It affects PHP 8.5.* before 8.5.13 and requires specific per-path INI or front-end parameter configuration.
Why it mattersA public writeup exists; exploitation can corrupt memory, crash workers, and may allow remote code execution on affected workers.
ActionUpgrade to PHP 8.5.13.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| PHP Group | PHP | >=8.5.0 <8.5.13 | 8.5.13 |
Exploit evidence
1 public sources
Coverage
News and research mentioning this CVE
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in PHP, strongest first
Embed
A live severity badge for an advisory, README or ticket