The PHP Foundation has released security updates to address multiple critical security flaws that could be exploited to achieve remote code execution on affected deployments, including CVE-2026-115560.
The release of the patch follows an advance notice in which the project maintainers alerted users to multiple critical vulnerabilities affecting all supported PHP versions under specific conditions, including non-default configuration or uncommon setups.
At a high level, successful exploitation of the defects could pave the way for remote code execution, session corruption, denial-of-service, memory corruption, or local privilege escalation.
The list of vulnerabilities is as follows –
- CVE-2026-115560 (CVSS score: 9.2) – An improper input validation vulnerability that could result in remote code execution, file modification, session corruption, or denial-of-service. (Fixed in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0)
- CVE-2026-129182 (CVSS score: 9.2) – A use-after-free vulnerability that could result in memory corruption and possible full remote code execution, as in the case of CVE-2026-109619. (Fixed in PHP 8.5.13, 8.6.0)
- CVE-2026-126714 (CVSS score: 9.2) – A Time-of-check Time-of-use (TOCTOU) vulnerability that could result in the execution of arbitrary code with the privileges of the PHP worker. Successful exploitation requires an attacker’s influence over the session data, an interruption at a useful point in the write, and an application with a suitable deserialization gadget chain. (Fixed in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0)
- CVE-2026-129289 (CVSS score: 9.2) – An inconsistent interpretation of HTTP requests vulnerability that could result in execution of attacker-controlled PHP code as the worker without another user’s interaction or a non-default PHP configuration. Successful exploitation requires a front end that enables persistent backend connections and an application path that opens “php://input” without reading it fully, such as nginx with fastcgi_keep_conn on, Apache mod_proxy_fcgi with enablereuse=on, HAProxy FastCGI applications that retain backend connections, and LSAPI. (Fixed in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0)
- CVE-2026-129474 (CVSS score: 9.2) – A use-after-free vulnerability that could result in remote code execution on PHP 8.5 and later. Successful exploitation depends on the application and requires control over enough request data to influence memory allocation, a reachable magic method call, and a fatal error at the relevant point. (Fixed in PHP 8.5.13, 8.6.0)
- CVE-2026-129481 (CVSS score: 9.2) – A use-after-free vulnerability that could cause an application’s session cleanup to fail and potentially corrupt memory, crash a reused PHP worker, or potentially allow remote code execution. (Fixed in PHP 8.3.37, 8.4.28, 8.5.13, 8.6.0)
- CVE-2026-129496 (CVSS score: 9.2) – A use-after-free vulnerability that could allow an unauthenticated remote attacker to crash PHP workers or execute arbitrary code with their privileges on an affected deployment. (Fixed in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0)
- CVE-2026-129291 (CVSS score: 8.8) – A use-after-free vulnerability that could result in local privilege escalation. Successful exploitation requires local code execution in an FPM worker, an affected pool with catch_workers_output enabled, the epoll event backend, and the ability to manipulate worker lifetimes and retain inherited pipe descriptors. (Fixed in PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0)
Depthfirst, which has codenamed CVE-2026-126714 “phpAfterShell,” has described it as a critical flaw that can enable a remote attacker to run arbitrary code on affected servers.
“If a pwrite()/ftruncate() update is interrupted, PHP may leave behind a malformed session file that is later loaded by session_start(), yielding an arbitrary deserialization primitive,” Depthfirst said. “Chained with another of our PHP-native deserialization-to-RCE findings, this leads directly to remote code execution.”
Put differently, the vulnerability turns an interrupted file write into a potential remote code execution primitive by manipulating how PHP writes session data to disk, causing it to interpret previously harmless data as executable object data.
It then exploits the unexpected session state where the PHP worker either dies while the write process is underway, leaving a partially updated file, or dies after the write is complete, but before content from the previous session is removed. Both scenarios lead to a mixture of two different session states.
“Depending on where the interruption happens, part of the new Session may already have been written while bytes from the previous Session remain on disk,” security researcher Yuhang Wu said. “The result can be a Session file containing the prefix of the new serialized data and the tail of the old one.”
“By carefully choosing the length fields in the new prefix, an attacker can make PHP’s Session decoder interpret leftover bytes that were previously just part of an ordinary string as separate Session entries and serialized objects. Nothing needs to be deserialized during the upload-progress callback itself. The attacker only needs to leave the right bytes on disk and wait for the application to call session_start(), at which point PHP reads the modified Session and deserializes those objects.”
Once the prefix of one valid session is spliced with the tail of a replacement session, a subsequent session treats the corrupted data as a legitimate server-side state. This, in turn, causes PHP to interpret it as a “different, valid Session” and ultimately enable remote code execution by chaining it with a memory-corruption in a PHP-native class.
It affects any application that runs an affected PHP version with file-based sessions. If immediate patching is not possible, it’s advised to turn off session upload progress.
Patches for the flaws are available in the following versions –
- PHP 8.2.36
- PHP 8.3.37
- PHP 8.4.28
- PHP 8.5.13
- PHP 8.6.0
Users who are using existing 8.2.x, 8.3.x, 8.4.x, and 8.5.x versions of PHP are advised to update to the latest version for optimal protection.