Researchers Disclose Critical PHP Vulnerability phpAfterShell Stemming from Incomplete Patch
Cybersecurity and privacy
Security firm DepthFirst disclosed a critical PHP vulnerability, CVE-2026-126714 (dubbed phpAfterShell), with a CVSS v4.0 score of 9.2 affecting PHP 8.2 and above. Stemming from incomplete patching of PHP2Shell, attackers can exploit a TOCTOU race condition in unauthenticated session file updates, combined with deserialization and memory corruption, to achieve remote code execution. The PHP Foundation has released security updates.
The PHP Foundation has released security updates addressing 18 vulnerabilities, highlighted by critical flaw CVE-2026-126714 reported by security firm DepthFirst. Named phpAfterShell, the vulnerability holds a CVSS v4.0 score of 9.2 and affects PHP versions 8.2 and later. Classified as a Time-of-Check to Time-of-Use (TOCTOU) race condition, the flaw allows attackers submitting unauthenticated multipart/form-data requests to disrupt session file writing. This enables manipulation of session data, which, when paired with PHP native class deserialization and memory corruption, leads to remote code execution (RCE). DepthFirst stated that the issue was identified during a review of the earlier PHP2Shell patch, revealing that write interruptions during upload progress tracking still left mixed data states that formed a new attack chain.
Key takeaways
- Vulnerability CVE-2026-126714 (phpAfterShell) carries a CVSS v4.0 score of 9.2 and affects PHP 8.2 and higher.
- The flaw exploits TOCTOU race conditions and interrupted session writes, enabling RCE via deserialization and memory corruption.
- DepthFirst noted the issue originated from incomplete fixes for PHP2Shell, leaving session file handling vulnerable to mixed-state corruption.
Source:iThome Read the original ↗
Prepared, checked and automatically published by AI; not individually reviewed by a human. Translation checked by AI.