Use-after-free in magic method backtraces can lead to remote code execution
2 public exploits exists; no exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 7%. Fixed in PHP 8.5.13.
Use-after-free in magic method backtraces can lead to remote code execution. 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. 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 may cause memory corruption, crash the PHP worker or, with knowledge of memory addresses, execute arbitrary code. php.ini-production enables zend.exception_ignore_args, which prevents this. This issue affects PHP versions 8.5.* before 8.5.13.
Briefing
Written from the sources below · deepseek-v4.1-flash
A use-after-free in PHP's magic method backtraces can read freed memory when argument collection for __call()/__callStatic() coincides with a fatal error, potentially enabling memory corruption or remote code execution. PHP 8.5.* before 8.5.13 is affected.
Why it mattersPublic exploit material exists and a remotely supplied request triggering a fatal error may crash workers or, with address knowledge, achieve code execution; EPSS is 7%.
ActionUpgrade to PHP 8.5.13; if unable, enable zend.exception_ignore_args (as php.ini-production does) to block the flaw.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| PHP Group | PHP | >=8.5.0 <8.5.13 | 8.5.13 |
Exploit evidence
2 public sources
Coverage
News and research mentioning this CVE
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in PHP, strongest first
Embed
A live severity badge for an advisory, README or ticket