BIT-php-2026-129182: Use-after-free via repopulation of last_fatal_error_backtrace global after shutdown
Use-after-free via repopulation of lastfatalerrorbacktrace 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 modphp worker can access the stale backtrace. The shutdown error requires per-path configuration of maxmemorylimit, or of zlib.outputcompression together with outputhandler (which .user.ini can also set). The early diagnostic requires Apache per-directory configuration or, for PHP-FPM, a PHPVALUE or PHPADMINVALUE 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
bitnami/libphpto a version that resolves this vulnerability.Fixed in 8.5.13 - Upgrade
Upgrade
bitnami/phpto a version that resolves this vulnerability.Fixed in 8.5.13 - Upgrade
Upgrade
bitnami/php-minto a version that resolves this vulnerability.Fixed in 8.5.13 - Upgrade
Upgrade
php/phpto a version that resolves this vulnerability.Fixed in 8.5.13
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Affected deployments use PHP 8.5 versions before 8.5.13 and process more than one request in the same PHP-FPM or mod_php worker. Exploitation depends on configuration paths available in the relevant PHP-FPM or Apache deployment.
What conditions are required for exploitation?
A fatal error must occur during request shutdown while modified INI settings are restored. This requires per-path max_memory_limit configuration, or zlib.output_compression together with output_handler; .user.ini can also set the latter combination. A later request to the same worker must trigger an early diagnostic through Apache per-directory configuration or, with PHP-FPM, a PHP_VALUE or PHP_ADMIN_VALUE parameter supplied by the front end.
What can be done if an update is not immediately available?
Remove or avoid the configuration combinations needed to trigger the shutdown error, particularly per-path max_memory_limit and zlib.output_compression used with output_handler. Also prevent the front end from supplying PHP_VALUE or PHP_ADMIN_VALUE to PHP-FPM, and review Apache per-directory PHP configuration that can produce early diagnostics.
What impact should operators expect if the issue is triggered?
The stale backtrace can be accessed after request memory has been freed, causing memory corruption and worker crashes. The issue may also permit remote code execution.