Understanding "PHP2Shell": Deep Dive Into the Critical PHP RCE Flaws (CVE-2026-109618 & CVE-2026-109619)

With PHP powering up to 70% of the Web, this is arguably the most sweeping vulnerability disclosure of all time. Patch your systems now.

  • Cybersecurity
  • Security
  • PHP
  • DevOps
  • Patch
  • Zero-day

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

  1. Update PHP Core Immediately: Upgrade to patched versions: PHP 8.5 to 8.5.12, PHP 8.4 to 8.4.27, PHP 8.3 to 8.3.36, and PHP 8.2 to 8.2.35.
  2. Apply Temporary OOM Mitigations: Set memory_limit=-1 using php_admin_value, keep post_max_size low (e.g., 8M or 32M), and enforce limits at the web server level for request size and nesting depth.
  3. Apply Temporary Stale State Mitigations: Disable upload progress globally with session.upload_progress.enabled=0, set fatal_error_backtraces=0 on PHP 8.5, and remove invalid per-request settings.
  4. Hunt for Indicators of Compromise: Check logs for recurring "allowed memory size exhausted" errors, worker segfaults, sudden process recycling, or anomalous PHPSESSID values, and inspect web roots for dropped PHP files.

Sources & Further Reading