Skip to content
DayZeroHub
Critical CVSS 9.2CVE-2026-129474

PHP 8.5: use-after-free in magic method backtraces (CVE-2026-129474)

PHP Group PHP

Summary

PHP 8.5.x versions before 8.5.13 have a use-after-free when collecting arguments of calls handled by __call() or __callStatic() for a backtrace. The source rates it critical (CVSS 4.0: 9.2) and states it can lead to remote code execution.

What happened

When collecting the arguments of a method call handled by __call() or __callStatic() for a backtrace, PHP can read stale values that may refer to freed memory (CWE-416). According to the description, if a fatal error such as exceeding memory_limit occurs while an application enters such a call, with fatal_error_backtraces enabled (the default) and zend.exception_ignore_args disabled, a remote attacker who controls enough request data to influence memory allocation could cause memory corruption, crash the PHP worker or, with knowledge of memory addresses, execute arbitrary code. The php.ini-production file enables zend.exception_ignore_args, which prevents this.

Why it matters

The source assigns critical severity and a CVSS 4.0 score of 9.2 (vector 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, per CNA:php). Exploitation requires specific configuration conditions and control over memory allocation. The source does not indicate active exploitation; CISA's KEV catalog does not list this vulnerability.

Affected products and versions

PHP (PHP Group): versions 8.5.x before 8.5.13 (>= 8.5.0, < 8.5.13).

ProductVersionsFixed in
PHP Group PHP8.5.x before 8.5.138.5.13
PHP Group PHP>= 8.5.0, < 8.5.13—

Action recommended by the source

The vendor indicates that the fixed version is PHP 8.5.13; details are in its release notes (https://www.php.net/ChangeLog-8.php#8.5.13) and security advisory (https://github.com/php/php-src/security/advisories/GHSA-8mjj-2r7p-4hg2). The description also notes that php.ini-production enables zend.exception_ignore_args, which prevents this issue.

Fixed in: 8.5.13

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-416

Relevant change history

  1. Advisory correction

    The preliminary version was replaced by the full write-up.

  2. Published

    Preliminary advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources