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).
| Product | Versions | Fixed in |
|---|---|---|
| PHP Group PHP | 8.5.x before 8.5.13 | 8.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
Sources and references
- https://www.php.net/ChangeLog-8.php#8.5.13 — PHP
- https://github.com/php/php-src/security/advisories/GHSA-8mjj-2r7p-4hg2 — CVE Program
- https://access.redhat.com/security/cve/cve-2026-129474 — NVD
- https://github.com/murrez/php2shell/blob/a8e24f4efab57f67384909d9408e42a74b973bfb/poc.py#L808-L816 — NVD
- https://ubuntu.com/security/CVE-2026-129474 — NVD
Weaknesses (CWE): CWE-416
Relevant change history
Advisory correction
The preliminary version was replaced by the full write-up.
Published
Preliminary advisory published.