AI-Discovered “PHP2Shell” RCE Vulnerabilities (CVE-2026-109618 & CVE-2026-109619): Technical Analysis, Mitigation Guide & NCSC Cyber Essentials Compliance
A landmark coordinated disclosure on 21 October 2026 has revealed two critical, unauthenticated Remote Code Execution (RCE) vulnerabilities in the core C runtime of the PHP programming language—collectively tracked as “PHP2Shell” (CVE-2026-109618 & CVE-2026-109619, CVSS 4.0 score 9.2). Uncovered by security researchers using frontier AI code-reasoning models to trace deep memory-exhaustion and interruption edge cases across decades-old C interpreter code, these flaws affect PHP versions 5.4 through 8.5 across PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, and LiteSpeed. Because exploitation occurs inside the PHP engine before application code runs, standard WordPress, Laravel, Drupal, Magento, or Moodle security plugins cannot block the attack.
php.ini hardening, and NCSC Cyber Essentials v3.3 controls.
1. How AI Uncovered the Core PHP Flaws
- CVE-2026-109618 (OOM Cleanup RCE — CVSS 9.2): When PHP hits an Out-of-Memory (OOM) limit mid-request (such as crafted
multipart/form-datauploads interacting withsession.upload_progress), PHP aborts vialongjmp(). Partially initialised heap structures are then evaluated during request cleanup, enabling unauthenticated shell execution. - CVE-2026-109619 (Stale Worker State / UAF — CVSS 9.2): Fatal error interruption leaves freed pointers active inside persistent worker pools (
PHP-FPM,Apache mod_php,FrankenPHP). The next HTTP request handled by that worker reuses corrupted pointers for RCE. - The AI Shift: Frontier AI models traced multi-step memory state transitions across C destructors that eluded manual audits for over a decade—warning defenders that AI now compresses the window between code audit and weaponised exploit.
2. Step-by-Step PHP2Shell Mitigation Guide
- Step 1 — Upgrade PHP Immediately: Deploy the emergency upstream releases published on php.net:
• PHP 8.5 →8.5.12| PHP 8.4 →8.4.27
• PHP 8.3 →8.3.36| PHP 8.2 →8.2.35
Crucial: Restart allphp-fpm/ Apache daemons and rebuild Docker images so persistent workers load the patched binary. - Step 2 — Emergency
php.iniWorkaround: If immediate patching is delayed, disable session upload progress tracking globally inphp.ini:session.upload_progress.enabled = 0 - Step 3 — Worker Recycling & WAF Rules: Lower
pm.max_requests = 500in PHP-FPM pools and enable Cloudflare / AWS WAF virtual patching rules.
3. How NCSC Cyber Essentials Mitigates This
- Control #5 (14-Day Patching SLA & EOL Removal): Under NCSC v3.3, any vulnerability rated CVSS 7.0+ (PHP2Shell is 9.2) must be patched within 14 days (by 04 November 2026). Furthermore, PHP 8.1, 8.0, 7.4, and 5.x are End-of-Life (EOL) upstream—running unpatched EOL PHP on internet-facing servers is an automatic Cyber Essentials Plus audit failure.
- Control #2 (Secure Configuration): Mandates disabling unneeded runtime features (such as
session.upload_progressand exposed debug modules) and running web workers under least-privilege service accounts (Control #3). - Control #1 (Boundary Firewalls) & Control #4 (Malware/EDR): Restricting inbound WAN exposure behind a reverse-proxy WAF and monitoring web worker child processes via EDR stops post-exploit web shells.
Need to Prove 14-Day Patch & NCSC Denzell Compliance for a Tender, School MAT, or Insurer?
Get an instant fixed-fee quote from £320 + VAT (includes Pre-Assessment Review, 14-Day Free Remediation Cover, and £25,000 complimentary cyber insurance for eligible UK SMEs).
Not an IT Specialist? Find Out Exactly What Action You Need to Take in 60 Seconds
You do not need to understand server code to protect your organisation. Answer 4 simple questions below to generate a plain-English action plan, a ready-to-send email for your web designer or IT support company, and links to official NCSC resources.
Over 75% of UK business websites use WordPress or PHP under the hood—even if you never see it.