---
id: CVE-2026-129182
title: >-
  Use-after-free via repopulation of last_fatal_error_backtrace global after
  shutdown
summary: >-
  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 executo…
severity: critical
cvss: 9.2
cvssVector: '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'
cvssSource: cna
cwe:
  - CWE-416
  - CWE-459
vendor: PHP Group
product: PHP
affected:
  - PHP >= 8.5.0 < 8.5.13
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-11-19T16:04:31.707809Z'
published: '2026-11-19'
updated: '2026-11-19'
sourceUpdated: '2026-11-19T16:56:40.495Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-129182'
references:
  - url: 'https://github.com/php/php-src/security/advisories/GHSA-2fjv-p558-g82m'
tags:
  - cve.org
ingestedAt: '2026-11-19T14:53:19.921Z'
epss: 0.11007
epssPercentile: 0.96007
---

## Overview

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.

## Affected

- `PHP >= 8.5.0 < 8.5.13`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
