Publicly disclosed in October 2026, PHP2Shell comprises two critical, unauthenticated Remote Code Execution (RCE) vulnerabilities (CVE-2026-109618 and CVE-2026-109619) in the PHP core runtime, affecting versions 5.4 through 8.5 with a CVSS score of 9.2 or higher.
What is PHP2Shell?
Discovered via AI-assisted code audits and Google's Wiz team, these flaws stem from memory handling anomalies and abnormal request terminations that allow remote attackers to execute arbitrary code. Active exploitation is occurring in the wild.
Technical Breakdown
CVE-2026-109618 (OOM Corruption): Triggered during complex request parsing when memory allocation fails or limits are exhausted. Abrupt tear-downs via longjmp leave internal pointers in an inconsistent state, allowing attackers to hijack instruction pointers.
CVE-2026-109619 (Stale Global State): Involves request-owned internal states (such as session.upload_progress) surviving past their lifecycle. Persistent worker processes like PHP-FPM can interact with freed, stale states, causing use-after-free vulnerabilities.
Immediate Remediation Steps
-
Update PHP Core Immediately: Upgrade to patched versions: PHP 8.5 to
8.5.12, PHP 8.4 to8.4.27, PHP 8.3 to8.3.36, and PHP 8.2 to8.2.35. -
Apply Temporary OOM Mitigations: Set
memory_limit=-1usingphp_admin_value, keeppost_max_sizelow (e.g., 8M or 32M), and enforce limits at the web server level for request size and nesting depth. -
Apply Temporary Stale State Mitigations: Disable upload progress globally with
session.upload_progress.enabled=0, setfatal_error_backtraces=0on PHP 8.5, and remove invalid per-request settings. -
Hunt for Indicators of Compromise: Check logs for recurring "allowed memory size exhausted" errors, worker segfaults, sudden process recycling, or anomalous
PHPSESSIDvalues, and inspect web roots for dropped PHP files.