CVE-2026-129474

Remote Code Execution
Affects
PHP
in
PHP
No items found.
Versions
>=7.1.0 <8.5.13

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

PHP is a general-purpose scripting language used mostly for web development. It runs behind web servers through server APIs such as Apache mod_php and PHP-FPM, and powers content management systems and frameworks such as WordPress, Drupal, Moodle and Laravel. The Zend engine can record a backtrace, including call arguments, when a fatal error occurs. Since PHP 8.5 it does so by default through the fatal_error_backtraces setting.

A Remote Code Execution (RCE) vulnerability (CVE-2026-129474) has been identified in how the Zend engine collects call arguments for a backtrace while a method handled by __call() or __callStatic() is being entered, which allows an unauthenticated attacker to make PHP read freed memory through a crafted request that triggers a fatal error at that point. Successful exploitation can execute code with the privileges of the PHP worker. The PHP project tracks this issue as GHSA-8mjj-2r7p-4hg2.

Per MITRE CWE-416: The product reuses or references memory after it has been freed.

This issue affects PHP 7.1 and later before 8.5.13. The remote attack has been established only for PHP 8.5, which is the only release line the PHP project lists as affected and the only one it patched. PHP 7.1 through 8.4 contain the same backtrace defect without that remote trigger. PHP 5.6 does not use trampoline call frames and is not affected.

Details

Module Info

Vulnerability Info

This Critical-severity vulnerability is found in the Zend engine of PHP 7.1 and later before 8.5.13. For PHP 8.5, where the remote attack applies, the PHP project scores it 9.2 under CVSS 4.0 (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).

Applications and frameworks often use __call() and __callStatic() to forward method calls to another object, for example in logging facades, database interfaces and service proxies. Before PHP enters the magic method, it represents the requested method as a separate trampoline call frame. In an ordinary user function frame, extra arguments are moved behind the function's local variables, but in a trampoline frame they are not. debug_backtrace_get_args() assumed the ordinary layout for every user function. In PHP 8.5.12, the code reads:

ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(arg_array)) {
    if (call->func->type == ZEND_USER_FUNCTION) {
        uint32_t first_extra_arg = MIN(num_args, call->func->op_array.num_args);

A backtrace taken while the trampoline frame is active can therefore collect values left behind by an earlier call instead of the current arguments, and some of those values can point to memory that has already been freed. With fatal_error_backtraces=1 and zend.exception_ignore_args=0, a fatal error raised at that moment, such as exceeding memory_limit or the execution time limit, makes PHP build such a backtrace. Processing or releasing it can corrupt memory or transfer control to an address chosen by the attacker.

The demonstrated remote attack requires both settings. Fatal error backtraces are on by default in PHP 8.5, and PHP's built-in default includes arguments, but php.ini-production sets zend.exception_ignore_args=1, which blocks this path. The attacker also needs a request path that reaches a magic method call, enough control over request data to influence memory allocation and to hit a resource limit at the right point, and, for code execution, knowledge of usable memory addresses. The advisory names Laravel facades and Magento guest shipping estimation as code paths that reach magic method calls, and states that exploitation of a complete installation of either has not been demonstrated.

Fatal error backtraces were introduced in PHP 8.5.0. The PHP project states that PHP 8.2 through 8.4 contain the underlying defect, and the same handling of trampoline frames is present in the End-of-Life PHP 7.1 through 8.1 lines. On those versions, reaching it requires a PCNTL signal handler or another component that inspects an interrupted call, and no attacker-controlled remote trigger has been established. The PHP project therefore lists only PHP 8.5 as affected and released a fix only for PHP 8.5. PHP 5.6 does not use trampoline call frames and is not affected.

The fix makes debug_backtrace_get_args() handle trampoline frames separately:

/* Extra args are moved after CVs and TMPs in user functions, except
 * for trampoline frames (see i_init_func_execute_data()).
 */
if (call->func->type == ZEND_USER_FUNCTION
 && !(call->func->op_array.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
    uint32_t first_extra_arg = MIN(num_args, call->func->op_array.num_args);

Mitigation

The PHP project released a fix only for PHP 8.5, the one release line where a remote trigger has been established. PHP 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 are End-of-Life, contain the same backtrace defect and will not receive any public updates to address it. PHP 8.2, 8.3 and 8.4 did not receive the fix either.

Until an upgrade is possible, set zend.exception_ignore_args=1 in the configuration used by the affected PHP workers, or set fatal_error_backtraces=0, and restart the workers. Check the effective configuration, including FPM pool settings and application overrides; changing only the CLI configuration is not enough. Setting display_errors=0 does not stop PHP from building the backtrace.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to PHP 8.5.13 or later.
  • Leverage a commercial support partner like HeroDevs (NES for PHP) for post-EOL security support.

Credits

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Critical
ID
CVE-2026-129474
PROJECT Affected
PHP
Versions Affected
>=7.1.0 <8.5.13
NES Versions Affected
Published date
November 19, 2026
≈ Fix date
November 19, 2026
Fixed in
Category
Remote Code Execution
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
PHP
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.