PHP2Shell: Your Application Code Is Clean, But the Engine Underneath It Isn’t
Two critical flaws in the core PHP engine, CVE-2026-109618 and CVE-2026-109619, let an unauthenticated attacker run code and read raw worker memory on nearly every PHP release since 5.4, even when the application code on top is fully patched.
TA2026309Published October 22, 2026Admiralty A1TA2026309A1CVE-2026-109618CVE-2026-1096199.2 v4.05.4 to 8.5.11Summary
PHP2Shell is a pair of critical flaws, CVE-2026-109618 and CVE-2026-109619, in the core PHP engine itself rather than in any application built on top of it. A site can be fully up to date and still be exposed simply because it runs PHP. Both flaws carry a CVSS v4.0 score of 9.2 and affect every PHP release from 5.4 through 8.5.11.
An unauthenticated attacker can run code on the server with the web worker's privileges and read raw memory from PHP worker processes, which can contain passwords, session tokens, API keys, and certificates from other users' requests. The flaws allow pre-authentication remote code execution against default WordPress, Drupal, and Joomla deployments, though exploitation does not depend on those platforms at all.
Exploitation came before the fix. The earliest recorded attempt was on 17 October 2026, and the PHP security team shipped an out-of-band emergency release on 21 October 2026: PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35. PHP 8.1 and older get no full release, only limited source backports for 7.4, 8.0, and 8.1. No threat actor or malware family has been publicly attributed.
Six IPv4 addresses are listed as indicators, but they are shared anonymization infrastructure, so investigate any hits rather than blocking them outright.
Affected Products
CVEs
| CVE | Name | Affected Product | Zero-Day | CISA KEV | Patch |
|---|---|---|---|---|---|
CVE-2026-109618 | PHP2Shell (PHP Out-of-Memory Corruption Vulnerability) | PHP Group PHP | No | No | Available |
CVE-2026-109619 | PHP2Shell (PHP Remote Code Execution Vulnerability) | PHP Group PHP | No | No | Available |
Vulnerability Details
- #01
An out-of-band emergency release from the PHP security team on
21 October 2026addressed two critical remote code execution flaws,CVE-2026-109618andCVE-2026-109619, grouped under the name PHP2Shell. Both are memory-safety defects in the core engine, and both trace back to the same underlying behaviour. When a request ends abnormally, most often because PHP hits an out-of-memory condition, the engine can tear down the request's heap while internal bookkeeping still points at that freed memory or still holds data that was only partially set up. The worker process survives and goes on to handle the next request, carrying that corrupted state with it. Because PHP workers are reused across requests, an attacker who can reliably trigger the failure can line up their own data in the memory the engine is about to trust. - #02
CVE-2026-109618is the out-of-memory corruption path. An out-of-memory error interrupts an operation partway through, leaving request data only partially initialized, and PHP's cleanup routines then process that invalid state as if it were valid. Chaining the weaknesses in this path gives remote code execution running as the web worker account.CVE-2026-109619is the stale global state path, where PHP keeps references to request-owned data after the backing memory has been freed; a later request handled by the same worker reaches those references before normal initialization resets them, producing a heap use-after-free that has been shown to yield both memory disclosure and remote code execution. The confirmed routes into this second flaw run through session upload-progress handling and, on PHP8.5, through retained fatal-error backtraces. - #03
Neither flaw requires authentication, and neither requires the target application to contain a bug of its own, which is what makes the attack surface so large. A minimal “Hello World” script on an affected runtime is exploitable. PHP has stated that the risk is highest for Apache
mod_php, where a demonstrated exploit fires before any application code runs at all, and PHP-FPM is not exempt because session-lifecycle remote code execution has been validated against it under suitable application conditions. Every PHP version from5.4up to8.5.11is affected. The fixes are in PHP8.5.12,8.4.27,8.3.36, and8.2.35. PHP8.1and anything older is past end of life, so those branches get no full release at all, and the project has published limited source backports for7.4,8.0, and8.1instead. - #04
Both CVEs carry a CVSS v4.0 base score of
9.2, placing them in the Critical band, which reflects unauthenticated network-reachable exploitation leading to full compromise of confidentiality, integrity, and availability. The attack traffic against these flaws was observed before patches were publicly available.
Vulnerabilities
| CVE ID | Affected Products | Affected CPE | CWE ID |
|---|---|---|---|
CVE-2026-109618 | PHP Group PHP (5.4 through 8.5.11) | cpe:2.3:a:php:php:*:*:*:*:*:*:*:* | CWE-1325, CWE-416, CWE-755, CWE-824 |
CVE-2026-109619 | PHP Group PHP (5.4 through 8.5.11) | cpe:2.3:a:php:php:*:*:*:*:*:*:*:* | CWE-1325, CWE-416, CWE-755, CWE-824 |
Recommendations
- 01Patch PHP Right Away
Update to PHP
8.5.12,8.4.27,8.3.36, or8.2.35, whichever matches your branch. This is the only complete fix. PHP8.2itself reaches end of life on31 December 2026, so patching to8.2.35buys roughly ten weeks; plan the move to8.3or later now. If you are on PHP8.1or older, those branches are past end of life and will not get a full release, so either pull a backported build from your Linux distribution or LTS vendor, apply the limited source backports PHP published for7.4,8.0, and8.1, or move to a supported version. - 02Start With Your Internet-Facing mod_php Servers
PHP has flagged Apache
mod_phpas the highest-risk configuration because a demonstrated exploit can fire before any of your application code runs. Work outward from there to PHP-FPM,php-cgi,lsphp, FrankenPHP, and LiteSpeed deployments. Anything that serves web requests and is reachable from the internet should be at the front of the queue. - 03Apply Temporary Mitigations Only If You Cannot Patch Today
For
CVE-2026-109618, setmemory_limit=-1in a way applications cannot override, such asphp_admin_valuein the FPM pool or Apache configuration, keeppost_max_sizelow at8Mwithout uploads or32Mwith them, and use container or cgroup limits as an availability boundary. Do not substituteRLIMIT_ASorRLIMIT_DATA, which PHP warns can themselves trigger the vulnerable allocation failure. ForCVE-2026-109619, setsession.upload_progress.enabled=0before request parsing and restart every worker, and on PHP8.5also setfatal_error_backtraces=0. Treat all of these as stopgaps that close known paths, not as protection. - 04Hunt for Signs of Compromise
Because these flaws execute below the application layer, your application logs may show very little. Look instead for unusual multipart requests followed by memory-limit errors or repeated HTTP
500responses, unexpectedly large or malformedPHPSESSIDresponse cookies, and unexplained PHP worker churn. Because these flaws can disclose raw worker memory, treat credentials, session tokens, and API keys that lived on an exposed server as potentially compromised and rotate them. - 05Edge Blocking for
CVE-2026-109618Block form field names of
1,000bytes or more. Every variant of this flaw needs a field name large enough that copying the key exhaustsmemory_limitduring request startup, which in practice means megabytes, so a 1 KB threshold sits far below the exploit minimum and still produces no false positives. Match names and not values by anchoring at a field boundary on urlencoded bodies, and cover the multipart variant separately by checking part header name lengths. Never gate onContent-Length, because chunked requests do not carry one and HTTP/2 does not require one, which makes a header-based size check a one-line bypass. As a backstop, rate-limit large POSTs to roughly ten per source IP per minute. - 06Edge Blocking for
CVE-2026-109619Exploit bodies here run to roughly
450bytes with short field names, so there is nothing to size-limit. Instead block three multipart shapes that no legitimate client sends, matching on part headers only so that uploaded file contents never trigger the rules. First, aPHPSESSIDform field, since the upload handler copies it into the session ID without checkingsession.use_only_cookiesand real clients send session IDs in theCookieheader. Second, a PHP open tag in a filename, limited to the full and short echo tags to avoid false positives on XML-style names. Third, serialized-object syntax in a filename, which is how the handler-mismatch chain writes its payload. Log thePHP_SESSION_UPLOAD_PROGRESSfield but do not block on it, because that is the legitimate progress-bar mechanism. These rules stop the write to the session file but not a later local file inclusion read, so purgesession.save_pathas part of the rollout. - 07PHP Fatal Error From an Unknown Script
In Apache or Nginx error logs, look for messages containing
PHP Fatal errortogether with “tried to allocate” and “in Unknown on line 0”. Ordinary application memory exhaustion names the file and the line responsible, so theUnknown on line 0phrasing means the allocation happened outside normal script execution. Treat this as a high-priority lead rather than proof, because it is not unique to PHP2Shell, and correlate it with oversized POSTs, connection resets, and worker crashes from the same source. - 08Web Server Spawning a Shell
Look for process events where the parent is
apache2,httpd,nginx,lighttpd,caddy,php-cgi,php-fcgi,php-fpm,lsphp, orfrankenphp, or where the process runs as a web server account such asapache,www-data, ornginx, and the child process is a shell such assh,bash,dash,zsh, orksh. Narrow on command lines containing-cor-lcalongside suspicious content such asid,whoami,hostname,nc,ncat,socat,xxd,base64,openssl,curl,wget,chmod,python,perl,/dev/tcp,/dev/shm/,/tmp/,/.ssh,/etc/passwd, or/etc/shadow. Web servers do legitimately spawn shells in some environments, so this one needs tuning. - 09Post-Exploitation Hunting
The exploit runs shell commands as the web server user without crashing the worker, so there may be no visible disruption at all. Look for unexpected child processes of web server and PHP workers, files created or modified in
/tmp,/dev/shm,/var/tmp, or web-writable directories by the web server user, and outbound connections from that user on non-standard ports. In logs, look for bursts of HTTP200responses to large POSTs from a single source carryingAllowed memory sizeerrors, since each successful attempt returns a200, and for hundreds of large POSTs from one address producingAH00052child process exit entries in Apache error logs. For persistence, check new or modified SSHauthorized_keysfiles under web server user home directories or/var/www, new cron entries for that user, and unfamiliar PHP files in web roots. Cover the period from17 October 2026, the earliest recorded exploitation attempt, rather than from the disclosure date or the date you patched.
Indicators of Compromise (IoCs)
| Type | Value |
|---|---|
IPv4 | 103[.]216[.]220[.]92 |
These IPs are shared anonymization infrastructure; investigate any hits rather than blocking them.
MITRE ATT&CK TTPs
T1190T1059T1505T1505.003T1098T1098.004T1053T1053.003T1033T1212T1211References & Patch Links
Patch Link
- PHP Release Announcement
https://www.php.net/archive/2026.php#2026-10-21-5
References
https://www.wiz.io/blog/php2shell-php-rcehttps://www.php.net/archive/2026.php#2026-10-21-5https://cloud.google.com/blog/products/identity-security/responding-to-core-php-vulnerabilities-cve-2026-109618-cve-2026-109619https://www.abstract.security/blog/php2shell-critical-php-rce-vulnerabilities-cve-2026-109618-and-cve-2026-109619https://zerodayclock.com/explorer?cve=CVE-2026-109618https://zerodayclock.com/explorer?cve=CVE-2026-109619https://calif.io/php2shell/#php-5-4-0-rcehttps://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/
