CVE-2026-129474: Use-after-free in magic method backtraces can lead to remote code execution.
Critical CVSS 9.2
- CVE id
- CVE-2026-129474
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| PHP Runtimes and servers |
>= 8.5.0, < 8.5.13 | 8.5.13 |
How to fix it
Upgrade PHP to 8.5.13 or later.
php --version
- Install the patched PHP release of your minor line (the php image tag or your OS packages) and restart PHP-FPM.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
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 memorylimit occurs while an application enters such a call, with fatalerrorbacktraces enabled (the default) and zend.exceptionignoreargs 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.exceptionignoreargs, which prevents this.
This issue affects PHP versions 8.5.* before 8.5.13.
References
- CVE-2026-129474 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-129474
- Web: https://github.com/php/php-src/security/advisories/GHSA-8mjj-2r7p-4hg2
- Web: https://access.redhat.com/security/cve/cve-2026-129474
- Web: https://github.com/murrez/php2shell/blob/a8e24f4efab57f67384909d9408e42a74b973bfb/poc.py#L808-L816
- Web: https://ubuntu.com/security/CVE-2026-129474
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.