BIT-libphp-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 to a fixed release to a version that resolves this vulnerability.
Fixed in 8.5.13
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using PHP 8.5 versions before 8.5.13 are affected. Exploitation requires requests to be handled by the same persistent PHP-FPM or mod_php worker across the shutdown-triggering request and a later request.
What configuration conditions are needed for exploitation?
The shutdown condition requires per-path configuration of max_memory_limit, or both zlib.output_compression and output_handler; .user.ini can set the latter pair. The later early diagnostic requires Apache per-directory configuration, or, with PHP-FPM, a PHP_VALUE or PHP_ADMIN_VALUE parameter supplied by the front end.
What can happen if the issue is exploited?
The stale fatal-error backtrace can be accessed after its request memory has been freed, causing memory corruption and worker crashes. Remote code execution may also be possible.