A memory bug that turns every PHP request into a potential shell
On 21 October 2026 the PHP project shipped emergency patches for two remote code execution flaws that researchers have nicknamed PHP2Shell. Both are tracked as CVE-2026-109618 and CVE-2026-109619 and both score 9.2 (CVSS v4.0). Neither requires authentication, and neither can be stopped by application code — the malicious request is processed by the PHP engine before any framework or login check runs.
What actually goes wrong
The two bugs share one root cause: PHP corrupting its own memory when a request ends abnormally.
- CVE-2026-109618 — a memory allocation fails, PHP runs out of memory and interrupts its work before some internal data has been initialised. During cleanup of that request, PHP uses the unfinished data as if it were valid, which chains into code execution as the web worker account.
- CVE-2026-109619 — a fatal error leaves PHP holding references to memory that is freed when the request ends. When the same worker picks up a later request, it follows those stale references, producing a heap use-after-free, memory disclosure and remote code execution.
The second flaw is the nastier of the two: because it crosses request boundaries, an attacker who lands on the same worker twice can act on leftovers from someone else's request.
How wide is this
Every PHP release from 8.2 up to the fixed versions is affected, across PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. The PHP team rates mod_php as the highest-risk configuration, since an unauthenticated request triggers the attack before any application code is reached. Fixed versions are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older get no official binary fix — only source backports that each distribution must decide to carry.
Researchers from Calif.io, Wiz, OpenAI and Quarkslab are credited with the findings, and Wiz demonstrated working unauthenticated RCE against WordPress, Drupal and Joomla.
Exploited before the patch existed
This is the part that matters for anyone who waited. Amazon's MadPot honeypots recorded the first exploitation attempt on 17 October, four days before the patches shipped, so someone outside the embargo already had enough detail to try. Public proof-of-concept code appeared around 02:00 UTC on 21 October, roughly twelve hours before the embargo lifted.
Cloudflare watched the traffic from the network side: thousands of attempts before the announcement, tens of thousands within 45 minutes, hundreds of thousands within two hours, and millions by the time of its statement. VirusTotal independently counted roughly 5.1 million IP addresses running PHP. Cloudflare pushed a set of WAF rules as a stopgap, but WAF signatures are a race, not a fix.
And a second flaw with no patch at all
On 23 October PHP published an advisory for CVE-2026-115560, a second RCE that is not fixed by the emergency release. It only bites applications with an unusual session configuration: session.serialize_handler set to php_binary or php_serialize, changed at runtime to php via ini_set() before session_start(), with session upload progress still enabled. There is no emergency patch — the mitigation is one configuration line: session.upload_progress.enabled=0 in php.ini.
What to do
- Patch now, and verify the running process, not the package. A host can run an updated CLI binary while an old FPM master keeps serving requests. Restart every worker and prove the version through the web SAPI.
- Hunt from 17 October, not from disclosure day. The pre-disclosure window is real. Look for processes spawned by web workers that do not match the normal pattern, new files in temporary upload paths, and outbound connections from the PHP user to unexpected hosts.
- Treat config workarounds as a timer, not a solution. Setting
memory_limit=-1, a lowpost_max_sizeand disabling session upload progress all reduce exposure — with working public exploits, the patch is the only complete fix.
PHP2Shell is a reminder that the layer below your application is where the last word is spoken. Framework middleware, auth guards and input validation all sit behind the vulnerable code path. When the engine itself is corrupting memory, none of them get a vote.
Sources: The Hacker News, Cloudflare, Datadog Security Labs, CISA alert
