phpAfterShell Remote Code Execution via Session Interruption
Score: 7/10

phpAfterShell Remote Code Execution via Session Interruption

PHP's upload-progress callback allows attackers to corrupt file-backed sessions via interrupted writes, leading to object deserialization and remote code execution.

Executive Summary

A critical vulnerability, CVE-2026-126714 (known as phpAfterShell), has been identified in PHP's session handling during multipart/form-data uploads. The flaw exists because PHP updates session files non-atomically during unauthenticated upload-progress updates. By intentionally interrupting a PHP worker process (e.g., via memory pressure or CPU-intensive multipart fields), an attacker can cause a 'splice' of session data, leaving a corrupted session file on disk.

Technically, this allows an attacker to inject serialized object bytes into a session file that are later interpreted as legitimate state when the application calls session_start(). By chaining this with memory corruption in native PHP classes, researchers achieved Remote Code Execution (RCE). This vulnerability bypasses previous mitigations for the related 'php2shell' flaw because it targets the storage persistence layer rather than just the memory-time execution.

This is a high-impact vulnerability (CVSS 9.2) affecting a wide range of PHP versions (8.2.x, 8.3.x, 8.4.x, 8.5.x, and 8.6.x). Organizations running PHP with file-based sessions and upload progress enabled are at risk, regardless of whether their specific application code handles file uploads.

Key Details

Threat Name

CVE-2026-126714 (phpAfterShell)

Affects

PHP 8.2, PHP 8.3, PHP 8.4, PHP 8.5, PHP 8.6

Adversary

—

MITRE Techniques

—

Malware/Tools

None identified

Report Score

7out of 10
Quality Score
Good
IOC Quality4
TTP Details8
Detection Guidance3
Enterprise Relevance7
Clarity & Structure9
Technical Depth10

Sources