PHP2Shell and the AI Exploit Race: A Defender’s Playbook for the Critical PHP Flaw
From the publisher’s feed, collected in the ZeroLabs newsroom.
Two critical bugs in PHP were found with help from frontier AI, and attackers are already probing for them. Here’s what happened, why AI changes the timeline and how to protect your servers.Image by the author.PHP is the engine behind WordPress, Drupal, Laravel and a huge share of the web. For more than a decade, two weaknesses sat inside it unnoticed. On Oct. 21, 2026, PHP shipped emergency fixes for them. The bugs, tracked as CVE-2026–109618 and CVE-2026–109619 and nicknamed PHP2Shell, can let an attacker with no login run code on a server [1][2].What sets this apart from a routine patch cycle is how the bugs were found. The researchers say frontier AI models helped them discover the flaws and turn them into a working exploit [1][2]. This article covers the timeline, why AI matters here, the ethical questions it raises and a practical checklist for defenders.What HappenedMid-August: Researchers at Wiz and Calif identified the vulnerabilities. Calif used an OpenAI model, and Wiz used its own AI agent along with models from Google and OpenAI [3].Oct. 17: Amazon’s honeypot network recorded an exploit attempt four days before public disclosure. Because the bugs were still under embargo, Amazon believes a threat actor was behind it. How the attacker got the details is unknown [4].Oct. 20: Details leaked ahead of the coordinated disclosure, and PHP published an advance notice [2].Oct. 21: PHP released fixes in versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35, a day ahead of the planned date [2][4]. watchTowr reported seeing exploitation in the wild the same day [5].Why This Flaw Is So SeriousMost PHP security stories involve one vulnerable plugin or one sloppy application. This one lives in the interpreter itself, so well-written application code doesn’t protect you.Every PHP installation that serves web requests is exposed, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP rates mod_php highest, because a single unauthenticated request can trigger the attack before any application code runs. Wiz says every version back to 5.4 is affected by at least one of the bugs [6]. Wiz also puts the potential reach at around 70% of the internet [1].The damage may not stop at code execution. Wiz says the bugs can also leak process memory, which can expose passwords, session tokens and API keys [7].Where AI Fits InThe vulnerable code had been in PHP for over a decade. According to Wiz, what changed was the ability to turn weaknesses into a working exploit. The team says it chained multiple flaws and adapted to each target’s memory layout through repeated testing, and that one researcher did in about a week what would have taken a world-class team months [1]. Wiz describes the exploit chain as being at the edge of what human researchers could practically do, and says frontier models lowered that barrier [4].The attacker side shows the same pattern. Security researcher Suiche of Tolmo told CNBC his team built a working exploit in under a day using AI, and that it would have taken multiple weeks before today’s models [3].Two caveats are worth keeping in mind. First, these are claims from the researchers and vendors involved, who benefit from the story. Second, humans still steered the work. The models did heavy lifting on discovery and exploit development, but “AI found it” doesn’t mean nobody was driving [13].The Ethical and Social QuestionsPHP2Shell raises problems that go beyond one patch. These are my own reading of the situation, not settled conclusions.Does coordinated disclosure still work at AI speed? Embargoes assume attackers need time to build exploits. If AI shrinks that time, the window between “someone knows” and “everyone can exploit” gets very short. Here the embargo broke early, an exploit reportedly appeared online hours before the patch, and Calif accidentally posted a proof-of-concept video [3][8]. One of the labs involved has described the head start before attackers catch up as a “Defender’s Window” [13]. Whether that window survives depends on how fast fixes ship compared with how fast leaks spread.Who bears the burden? A large company can patch in hours. A small business on shared hosting, a volunteer-run site or an organization running end-of-life PHP may not even know it’s affected. The people with the least capacity to respond often hold the most exposed systems.How do we handle the exploit flood? More than 100 PHP2Shell-related repositories appeared on GitHub after disclosure, and Tenable warned that unverified exploit code may carry malware [7]. Defenders who download “proof-of-concept” code to test their own servers can end up infecting themselves.Who gets the best models? The same capability that helps researchers find bugs first can help attackers reproduce them. How access to powerful models is governed is now a security question, not just a business one.A Defender’s Playbook1. Find every PHP install that serves web traffic. Check php -v, php-fpm -v and whether mod_php is loaded. Also check Docker base images, staging servers and vendor appliances. The CLI version often differs from the web-facing one.2. Patch and restart. Update to the latest release of your branch (8.5.12, 8.4.27, 8.3.36 or 8.2.35) [2]. Restart PHP-FPM or Apache so the new binary loads, and rebuild containers with fresh base images. Verify your package source actually has the fix. At least one popular third-party RPM repository warned it wouldn’t have updates on release day [9].3. Deal with old PHP versions honestly. Upgrading to a supported branch is the real answer. Some vendors are shipping patched images for older lines as a stopgap [10].4. Use temporary mitigations only as a bridge. Qualys lists a per-worker memory limit for CVE-2026–109618, session.upload_progress.enabled = Off for CVE-2026-109619 and fatal_error_backtraces = Off on PHP 8.5 [11]. PHP itself says there are no complete mitigations and that updating is the only safe choice [7].5. Hunt for signs of an attempt. Imperva suggests searching logs for unusually large multipart payloads, an excessive number of request fields, odd PHPSESSID cookie values, out-of-memory errors and PHP worker crashes [8]. Also look for unfamiliar .php files in web roots and web server processes spawning shells.6. Consider rotating secrets. Because memory disclosure can expose credentials and is hard to detect after the fact, rotating database passwords, API keys and session secrets on exposed, unpatched servers is a reasonable precaution [7].7. Add an edge layer, but don’t rely on it. F5 reported that its existing WAF signatures flagged a PHP2Shell-style request before dedicated signatures existed. That is vendor-run testing, so treat it as encouraging rather than proven [12]. Cloudflare has already reported attempts to evade its protections [11].8. Don’t run random exploit code. Test with trusted scanners or your vendor’s checks, on systems you own.What This Means Going ForwardPHP2Shell looks like a preview. Old, well-hidden flaws can now be turned into exploits faster than before, by both defenders and attackers. A few habits will matter more:Keep an up-to-date inventory. You can’t patch what you can’t list.Make emergency patching routine. If a PHP upgrade takes you weeks, fix that process before the next disclosure.Stay on supported versions. End-of-life software gets no upstream fix.Limit the blast radius. Use low-privilege users, containers with read-only filesystems and restricted outbound traffic.Use AI defensively too. Code audit, log triage and anomaly detection are areas where the same technology can shrink the attacker’s head start.The Short VersionInventory your PHP installs.Patch to the fixed version and restart.Hunt for signs of exploitation and rotate secrets if exposed.Plan to move off unsupported PHP.Expect the next AI-assisted disclosure to be faster.Disclosure: I have no financial relationship with any company mentioned in this article. Details were current as of Oct. 22, 2026, and this situation is changing quickly, so check the vendor advisories below for updates.References[1] Wiz Research, “PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet,” Wiz Blog, Oct. 2026. Accessed: Oct. 22, 2026.[2] S. Khandelwal, “PHP issues emergency patches for two critical PHP2Shell RCE flaws as exploit attempts emerge,” The Hacker News, Oct. 21, 2026. Accessed: Oct. 22, 2026.[3] CNBC, “‘PHP2Shell’ vulnerability: What is it, and is your data at risk?,” CNBC, Oct. 22, 2026. Accessed: Oct. 22, 2026.[4] Help Net Security, “PHP2Shell: Critical PHP vulnerabilities patched, update now!,” Help Net Security, Oct. 21, 2026. Accessed: Oct. 22, 2026.[5] watchTowr, “PHP remote code execution FAQ: CVE-2026–109618,” watchTowr Intelligence, Oct. 2026. Accessed: Oct. 22, 2026.[6] Patchstack, “Major security alert: PHP vulnerable to critical RCE, attacks ongoing,” Patchstack, Oct. 21, 2026. Accessed: Oct. 22, 2026.[7] Cyber Kendra, “PHP2Shell: Critical PHP flaws allow remote code execution,” Cyber Kendra, Oct. 21, 2026. Accessed: Oct. 22, 2026.[8] P. Pillitteri, “PHP2Shell exploit goes public before PHP patch as author walks it back,” Oct. 2026. Accessed: Oct. 22, 2026.[9] Rapid7, “CVE-2026–109618 and CVE-2026–109619: Critical unauthenticated remote code execution in PHP,” Rapid7 Blog, Oct. 21, 2026. Accessed: Oct. 22, 2026.[10] Aikido, “PHP2Shell: Critical PHP vulnerabilities, affected versions and fixes,” Aikido Blog, Oct. 21, 2026. Accessed: Oct. 22, 2026.[11] Qualys, “Two critical PHP flaws: How to find, mitigate and patch PHP2Shell now,” Qualys Blog, updated Oct. 22, 2026. Accessed: Oct. 22, 2026.[12] F5, “AI found it. AI is stopping it.,” F5 Blog, Oct. 2026. Accessed: Oct. 22, 2026.[13] “PHP2Shell: How AI found a 14-year-old bug in PHP, and why the patch race is on,” Towards AI, Oct. 2026. Accessed: Oct. 22, 2026.PHP2Shell and the AI Exploit Race: A Defender’s Playbook for the Critical PHP Flaw was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.