PHP2Shell: two pre-auth RCEs in PHP, found with AI's help
Two critical flaws let an unauthenticated request run code on PHP web servers; PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix them, and AI-assisted research found them.

On this page
PHP shipped 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on 21 October 2026 to fix two critical vulnerabilities that can let an unauthenticated request run code on a web server[1]Security advisory: Critical remote code execution vulnerabilities, update now. Both are rated 9.2 on CVSS v4.0[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w)[3]RCE via stale global state (GHSA-6wmf-4rv5-p3rp). Researchers at Calif and Wiz each found them in August with help from AI models[4]PHP2Shell: A tale of two PHP remote vulnerabilities[5]PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet. Updating is the only complete fix[1]Security advisory: Critical remote code execution vulnerabilities, update now.
What's affected
PHP says every installation serving web requests is affected: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed, with the highest risk under mod_php[1]Security advisory: Critical remote code execution vulnerabilities, update now. The flaws sit in PHP's engine rather than in any framework, so Wiz says even a "Hello World" script on an affected version can be vulnerable; it demonstrated exploits against WordPress, Drupal and Joomla[5]PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet.
Wiz's headline says the flaws affect "70% of the Internet"[5]PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet. Nobody has published a count of vulnerable servers: the scan numbers below count PHP installations[6]Oct 21 Advisory: php2shell - PHP Unauthenticated Remote Code Execution [CVE-2026-109618, CVE-2026-109619].
The two bugs are tracked as:
- CVE-2026-109618, "RCE via OOM corruption"[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w)
- CVE-2026-109619, "RCE via stale global state"[3]RCE via stale global state (GHSA-6wmf-4rv5-p3rp)
How the bugs work
Both come down to PHP being interrupted partway through something and then trusting what it left behind.
Out of memory at the wrong moment. When a request runs out of memory, PHP jumps straight out of it with longjmp(). In some places request memory is reachable before it's fully set up, so an allocation failure there leaves invalid state that request shutdown then reads[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w). The failing allocation needn't have anything to do with the corrupted memory, and multipart form parsing offers several ways to run out of memory while appearing to stay inside the configured limits[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w). The fix drops longjmp() for out-of-memory errors: PHP now stops at the next safe point, or exits the process immediately past a second, higher threshold[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w).
State that outlives its request. PHP keeps global state for errors, sessions and extensions. In a worker that serves many requests, a fatal error such as running out of memory or time can interrupt the reset of that state, and cleanup code can write new error data after it was cleared[3]RCE via stale global state (GHSA-6wmf-4rv5-p3rp). Code that runs before the next request is initialized, such as session upload progress handling, can then follow a pointer to freed memory[3]RCE via stale global state (GHSA-6wmf-4rv5-p3rp).
mod_php and FrankenPHP are the most exposed because they always run request shutdown[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w). PHP-FPM is at risk too, though the advisory notes nobody has yet shown a full exploit against it; the session upload progress path did work against both mod_php and FPM in testing[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w)[3]RCE via stale global state (GHSA-6wmf-4rv5-p3rp).
What AI did, and what people did
Calif, in research by Ryan Austin, found several paths to remote code execution on 1 August, reported the first bug to PHP on 11 August and the second on 21 August[4]PHP2Shell: A tale of two PHP remote vulnerabilities. Calif describes the model as a "companion" for finding ways past memory_limit and an "audit buddy" agent for reviewing the memory manager and request shutdown, with no special harness or restricted models[4]PHP2Shell: A tale of two PHP remote vulnerabilities. The human part was the theory: knowledge of PHP's memory-limit bugs going back to 2004, and steering the models toward that old technique instead of the newer bugs they gravitated to[4]PHP2Shell: A tale of two PHP remote vulnerabilities.
Wiz's timeline has its researchers finding the first bug on 19 August with its own Wiz Atlas tool plus the Gemini 4 Argon and GPT-5.6 Sol models, confirming unauthenticated code execution against Drupal and WordPress within two days, and reporting to PHP on 24 August[5]PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet. Wiz says it "worked with the PHP team, Calif and OpenAI on discovery, coordination and patch verification"[5]PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet, and PHP's advisories list four reporters[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w).
The bug class wasn't new. Calif's timeline includes a 2020 PHP bug report about out-of-memory conditions and a 2024 audit that found a related issue without proving it exploitable[4]PHP2Shell: A tale of two PHP remote vulnerabilities.
Exploitation and exposure
Censys's scans count about 4.2 million hosts and 67.6 million web properties running PHP; those are installations, not confirmed vulnerable servers[6]Oct 21 Advisory: php2shell - PHP Unauthenticated Remote Code Execution [CVE-2026-109618, CVE-2026-109619]. Reports on attacks conflict. Censys cites Amazon calling CVE-2026-109618 "broadly exploited in the wild", including an attempt on 17 October before disclosure, while Dataminr saw mostly scanning and no confirmed compromises as of 22 October[6]Oct 21 Advisory: php2shell - PHP Unauthenticated Remote Code Execution [CVE-2026-109618, CVE-2026-109619]. Cloudflare said it was seeing early attacks and attackers changing payloads to get past its rules, and watchTowr reported attempts against both CVEs[7]PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts Emerge. On 26 October, CISA added both to its Known Exploited Vulnerabilities catalog[8]Critical Vulnerabilities in PHP Require Immediate Patching.
Some operators didn't wait. BambooHR took its service offline in the US, Canada and Ireland as a precaution, and in the Netherlands DigiD, MijnOverheid and the lower house's website went offline, according to the broadcaster NOS[7]PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts Emerge.
What to do now
-
Update to 8.5.12, 8.4.27, 8.3.36 or 8.2.35. PHP's release notes say there are no complete mitigations[1]Security advisory: Critical remote code execution vulnerabilities, update now. If your PHP comes from a Linux distribution, check the vendor's security notice for the fixed package: distributions often patch without changing the version number PHP reports.
-
If you can't update today, PHP lists stopgaps that reduce exposure but "do not make an installation safe"[1]Security advisory: Critical remote code execution vulnerabilities, update now:
; set where applications can't override them, then restart every worker memory_limit = -1 post_max_size = 8M ; 32M if you accept uploads upload_max_filesize = 4M ; keep below post_max_size session.upload_progress.enabled = 0 fatal_error_backtraces = 0 ; PHP 8.5 onlyDon't rely on
ini_set()or.user.inifor these, and don't useRLIMIT_ASorRLIMIT_DATA[1]Security advisory: Critical remote code execution vulnerabilities, update now. If your application doesn't take multipart form data, block those requests in front of PHP[2]RCE via OOM corruption (GHSA-w8hw-w9fx-j79w). -
Older branches: PHP 8.1 and earlier get no releases, only source backports for 7.4, 8.0 and 8.1, and support for 8.2 ends on 31 December 2026, so plan that upgrade now[1]Security advisory: Critical remote code execution vulnerabilities, update now. CISA advises taking PHP systems offline if you can't patch them, including anything on 8.1 or older[8]Critical Vulnerabilities in PHP Require Immediate Patching.
-
Inventory and watch: CISA recommends finding every PHP install, including PHP embedded in other software, and watching for PHP workers that launch shells or download tools[8]Critical Vulnerabilities in PHP Require Immediate Patching.
Our take
Neither bug needed a new idea: both belong to a class of failure PHP has known about for two decades[4]PHP2Shell: A tale of two PHP remote vulnerabilities. What changed is how quickly two teams turned an old theory into working exploits, with models doing much of the legwork. Attackers have the same tools, and attempts showed up the same day the fixes did, by Amazon's account even before[7]PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts Emerge[6]Oct 21 Advisory: php2shell - PHP Unauthenticated Remote Code Execution [CVE-2026-109618, CVE-2026-109619]. Treat engine-level security releases like this one as same-day work.
Sources
- 1Community
- 2RCE via OOM corruption (GHSA-w8hw-w9fx-j79w)CommunityPHP · 2026-10-21
- 3RCE via stale global state (GHSA-6wmf-4rv5-p3rp)CommunityPHP · 2026-10-21
- 4Community
- 5Community
- 6Oct 21 Advisory: php2shell - PHP Unauthenticated Remote Code Execution [CVE-2026-109618, CVE-2026-109619]CommunityCensys · 2026-10-21
- 7PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts EmergeCommunityThe Hacker News · 2026-10-21
- 8Critical Vulnerabilities in PHP Require Immediate PatchingCommunityCISA · 2026-10-21