packet-autopsy.com

Case 003 · Incident: 17–22 Oct 2026

PHP2Shell: The PHP bug that took governments offline

PHP2Shell is the name for two critical flaws in the PHP engine, CVE-2026-109618 (out-of-memory corruption) and CVE-2026-109619 (stale global state). Each is rated 9.2 under CVSS v4.0, and they can allow unauthenticated remote code execution on web servers running nearly every PHP version back to 5.4. Researchers from Calif, OpenAI and Wiz used AI tools to find and report the flaws in August 2026.

Watch on YouTube

A flaw in the engine of the web

Calif says a memory flaw in PHP was first found in 2020, then found again during an audit in 2024. The researchers say AI models later helped one of them turn it into a working exploit in about a week. They say that work would otherwise have taken a team months.[1][2] The engine is PHP. Because these defects live in PHP itself, and not in any one content system, SecurityWeek reported that they affect 70 percent of all websites in the world. KrebsOnSecurity put it a little more cautiously: nearly 70 percent of websites need to update.[1][3] Researchers at Wiz, Calif and OpenAI found and reported the flaws, which reach nearly every PHP version back to PHP 5.4. A PHP core developer had already seen signs of the out-of-memory flaw during PHP's 2024 external audit, but found no route to code execution at the time. Calif and OpenAI each reported the issue on their own on August 11, and fixes shipped on October 21.[1][2]

The pair carries two official identifiers, CVE-2026-109618 and CVE-2026-109619. The Canadian Cyber Centre classifies both as use-after-free bugs. That means the software keeps using memory it has already released. Each is rated 9.2 under version four of CVSS, the standard severity scale. That is the rating in PHP's own disclosure, though other scoring bodies disagree, so how severe these flaws really are is still debated.[2][4] Both come from one root problem. When a web request ends abnormally, PHP can leave its memory in a corrupted state, and that corruption can be turned into remote code execution.[5]

Stage one: initial access

We split the attack path into four links, drawn from two kinds of source. Unit 42, the threat research team at Palo Alto Networks, documented one attack on a European government entity, but the facts we have do not say how those attackers got in. So links one and two describe the general risk set out by PHP and security reporting. Links three and four come from Unit 42's case, which is one documented attack, not the path every attacker took.[2][5][6] Link one is initial access. PHP says the risk is highest for mod_php, one common way of running PHP inside a web server. There, a demonstrated exploit lets an unauthenticated request, one sent without any login, trigger the attack before any application code runs.[5] The mechanisms are subtle. In the first flaw, CVE-2026-109618, PHP runs out of memory partway through setting up a request and stops early. The cleanup code then treats that half-built data as valid.[7]

In the second flaw, internal state from one request survives after its memory is freed. A later request handled by the same worker can then use that stale state. According to the PHP security advisory, every PHP installation that serves web requests is at risk, from PHP-FPM and Apache mod_php to php-cgi, FrankenPHP and LiteSpeed.[2][7] The first attempt came early. Amazon says it detected an exploit attempt against MadPot, its honeypot service, on October 17, 2026, while the flaws were still under embargo. A honeypot is a decoy system set up to attract attackers. Whether that attempt would have worked against a real system is still unknown.[8] Amazon believes a threat actor was behind it, but it remains unclear how that actor got exploit information before disclosure. Defenders were moving too: SecurityWeek reported that Cloudflare deployed protections nine hours before public disclosure, while Cloudflare itself says it switched its firewall rules on by default at 03:02 UTC on October 21, before the patch. After switching them on, Cloudflare watched attackers change their payloads, the malicious content of their requests, to get around those rules.[1][2][8]

Stage two: foothold

Link two is the foothold. If the memory corruption succeeds, an attacker can run code on the server. Even without that, an attacker can read the PHP worker's memory, which may hold passwords, authentication tokens, API keys and certificates belonging to other requests.[2][5] The foothold is almost invisible. CrowdStrike says the only server-side trace is a single memory-limit fatal error in the web server's log, the kind of message that is usually dismissed as noise.[8] Reliability is the attacker's problem. Red Hat says a dependable exploit needs precise heap manipulation and timing, and incident responders say address space layout randomization has been holding attackers back. VulnCheck built a technique to bypass it and knows of no other exploit that does the same.[9][10]

Stage three: movement

Link three is movement. In the one detailed post-exploitation case, from Unit 42, attackers using agentic AI set up an NTLM-relay tunnel into Active Directory, the directory that controls Windows logins across an organization.[6] Here the evidence splits. Unit 42 reports one successful compromise, at a European government entity, and no other source we cite has confirmed one: SecurityWeek reported that watchTowr saw mass exploitation attempts after release, but none of the circulating proof-of-concept exploits, the demonstration attacks shared online, achieved remote code execution, and the PHP Foundation found no working exploits among those circulating before release. So beyond Unit 42's single case, whether real-world attacks succeeded is still an open question.[6][11][12]

Stage four: the objective

Link four is the objective. Unit 42 reports that in that case, within two hours of the initial exploitation, the attackers reached password hashes and multi-factor authentication secrets, and attempted Domain Admin privilege escalation, a push for the account that controls an entire Windows network. It is the only successful compromise reported in our sources.[6] Other attackers aimed lower. The Hacker News reported that some tried, without success, to use these flaws to install a Mirai botnet variant called Potassium. Its goal was flood attacks against two adjacent hosts on a single Ukrainian network.[13] A separate operator built a full toolkit. SOCRadar assessed it as financially motivated and focused on cryptocurrency and Web3 targets, but as of October 22 saw no evidence of shell access on any site it screened. At least one Chinese IP address also tried, and failed, to drop a webshell.[11][13][14]

Hunt.io reported an operator running 10 attack rounds, expanding the target list to 123 servers at cloud providers, shared hosting companies and internet service providers. According to SecurityWeek, roughly 57 of those servers ran PHP, 10 rejected the requests, and none was successfully exploited.[14]

The leak and the scramble

Public disclosure was meant to be coordinated. Then, on October 20, a post on the Hacker News forum revealed that two PHP remote code execution flaws would be disclosed on Thursday, October 22. According to BleepingComputer, the security firm watchTowr then publicly confirmed the leaked flaws were real.[15][16] Events moved fast. The leak included the two CVE identifiers and mitigation advice given to some critical infrastructure providers. Around 20:00 UTC, Calif mistakenly posted a video of its working proof of concept, and PHP published an advance notice at 19:33 UTC and pulled its release forward by a day.[2][15][17] There was one more complication. At 07:41 UTC on October 21, about six hours before the fix shipped, the vendor Chainguard published built images containing the patch. The PHP Foundation said this let any attacker study the fix while everyone else waited; Chainguard's chief executive said he had already seen exploitation attempts and made a judgement call.[1][2][12]

PHP published the fixes around 14:00 UTC on October 21, a day before the planned disclosure. They are in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, and the team says only updating fully protects a server.[2] The Foundation did not hide from its part. It called its earlier delay in fixing the flaw a structural failure of its decision process and resources, and said it has since changed how it makes security decisions and added staff and tooling.[2]

Did it actually work?

Once the fix was public, the internet lit up. Cloudflare's chief executive said exploit attempts jumped to tens of thousands within 45 minutes of the announcement, hundreds of thousands within two hours, and millions after that.[11] Attempts are not the same as success. SecurityWeek reported that watchTowr saw mass exploitation attempts, but none of the circulating proof-of-concept exploits achieved code execution. The PHP Foundation had already found no functional exploits among those circulating before release. And according to The Record, Sophos reported and then retracted a report of successful exploitation.[10][11][12] So the central question stays open. Unit 42 describes that European case, while watchTowr and the PHP Foundation found no working exploits among the ones they examined. And as of the morning of October 23, the United States cybersecurity agency CISA had not added either flaw to its Known Exploited Vulnerabilities catalog.[6][11][12][14]

The harder problem is old software that no longer gets official fixes, known as end-of-life versions, and the estimates differ. Qualys puts about 71 percent, roughly 110 million instances, on end-of-life PHP versions 5.4 through 8.1, and says most of them will never get a vendor patch. Cisco Talos puts end-of-life use nearer 50 percent.[14][18] Other counts look very different, because they measure different things: Censys, which scans the internet, found about 2.58 million internet-facing hosts and 54.9 million web properties running PHP, far below Qualys's 110 million instances. Ox Security found that more than 99 percent of instances were not advertising a patched version 24 hours after the fix. That measures the version a server displays, which is not always the full picture of what it runs.[3][14][19] Many chose to simply pull the plug. The UK government confirmed 32 digital services unavailable and four partly down; in the Netherlands, MijnOverheid, DigiD and the lower house of parliament's site went offline; and at least one European government took its website down as a precaution.[2][6][13]

Companies did the same. BambooHR took its service offline across the United States, Canada and Ireland and warned payroll would be interrupted; Nintendo and others pulled services; Sophos found a vulnerable PHP version on its MyUTM portal; and Palo Alto Networks confirmed every version of PAN-OS and Panorama is affected.[2][9][20][21] Two days later came a footnote. PHP disclosed a separate issue, CVE-2026-115560, which it says affects only web applications configured in an unusual way and considers an unlikely risk.[22]

Breaking the chain

For defenders, the advice converged: CISA urged an immediate update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, PHP published minimal source backports for 7.4, 8.0 and 8.1, and core developer Gina Peter Banyard put it plainly: the only mitigation is patching or upgrading PHP. Until then, PHP's partial, temporary steps for CVE-2026-109619 are to switch off session upload progress, and on PHP 8.5 also fatal error backtraces, and then restart every PHP worker. For CVE-2026-109618, PHP says to set the memory limit to unlimited, minus one, so applications cannot override it, keep the maximum post size low and cap request sizes at the web server or proxy; and if that would take too long, the UK's National Cyber Security Centre says to consider taking the system offline.[2][5][7][11][23] Calif says this out-of-memory flaw was first found in 2020 and rediscovered in a 2024 audit, while The Hacker News dates the first signs to that 2024 audit, when nobody found a route to code execution. The researchers say AI later helped turn it into a working exploit in about a week, and after a leak on October 20, PHP shipped the fixes a day early, on October 21. But Qualys estimates that roughly 110 million instances run end-of-life PHP versions, and most of them will never get a vendor patch, so this story is not over.[1][2][14][15]

What to do

  • To shrink this first link while you patch, cap request and upload sizes at the web server or proxy, and switch on managed firewall rules. Treat both as a stopgap, because attackers can change their requests to slip past firewall rules. Only updating PHP to a fixed release actually closes this link.
  • The researchers suggest watching for unusual multipart requests, the kind that upload form data in several pieces, followed by memory-limit errors or repeated server errors, along with oddly large PHP session cookies and PHP workers that restart for no clear reason. The FBI advises monitoring for any PHP process that unexpectedly launches a command shell or downloads files. And run PHP under an account that can reach as little as possible, so a foothold stays small.
  • Segmentation limits how far a web server can reach, so keep web servers away from your domain controllers, and alert on any NTLM login coming from a web-facing host. NTLM is an older Windows login method, and attackers can relay it, which means passing a captured login on to another server. Require signing on SMB file-sharing and LDAP directory traffic, turn on LDAP channel binding and Extended Protection for Authentication so relayed logins are rejected, and reduce or switch off NTLM wherever your systems allow it.
  • Attackers want different things, but any secret a web process handles can become a target. If a web server may have been exposed, assume the passwords, tokens and keys it handled may have leaked. Keep multi-factor seeds and long-lived secrets out of web-facing systems, and rotate anything those systems touched.
  • If you run anything on the web, start with an inventory. You cannot patch what you do not know you have.

Open questions

  • How did the actor behind the October 17 honeypot probe get exploit information while the flaws were still under embargo?
  • Has any real-world compromise succeeded? Unit 42 describes a post-exploitation case at a European government entity, while most other sources report no confirmed compromise.
  • Would any of the pre-disclosure exploit attempts have worked against real systems? Amazon says technical analysis is ongoing.
  • How bad is the real-world severity? Red Hat scores both bugs 8.1, NVD gives 9.8 and PHP gives 9.2.
  • How many end-of-life PHP installations will ever be patched or backported?
  • Which versions are affected by CVE-2026-115560, when will it be fixed, and does it share a root cause with CVE-2026-109619?
  • How quickly will ASLR-bypass exploits like VulnCheck's spread to other attackers or into botnet tooling?
  • Were Potassium/Mirai payloads ever fetched or run successfully? Arctic Wolf says its data does not show this.

Sources

  1. [1]SecurityWeek — PHP2Shell Patches Land as First Exploitation Attempts Hit Sensors
  2. [2]The Hacker News — PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts Emerge
  3. [3]KrebsOnSecurity — Widespread PHP Flaw May Cause Many Site Outages Today
  4. [4]Canadian Centre for Cyber Security
  5. [5]BleepingComputer — PHP ships emergency patches for critical PHP2Shell flaws
  6. [6]Unit 42 (Palo Alto Networks) — Threat Brief: Critical Vulnerabilities in PHP: CVE-2026-109618, CVE-2026-109619
  7. [7]NCSC UK — Critical security issue affecting PHP
  8. [8]The Hacker News — Someone Tried to Exploit PHP2Shell 4 Days Before the Vulnerabilities Were Publicly Disclosed
  9. [9]SecurityWeek — Tech and Security Companies Respond to PHP2Shell Vulnerabilities
  10. [10]The Record — Reports of PHP bug exploitation attempts grow as experts downplay viability of exploits
  11. [11]SecurityWeek — PHP2Shell Exploitation Started Days Before Patches
  12. [12]The Record — PHP says AI review of critical bugs first sparked alarm in August, but signs surfaced in 2024
  13. [13]The Hacker News — PHP2Shell Exploit Attempts Hit Millions as Attackers Try to Deploy Mirai Malware
  14. [14]SecurityWeek — Mirai Botnet Operators Join PHP2Shell Attacks as ASLR Bypass Exploits Emerge
  15. [15]The Hacker News — PHP2Shell: Two Unpatched Critical PHP RCE Flaws (CVSS 9.2) Trigger Emergency Security Alert
  16. [16]BleepingComputer — PHP warns admins of two critical flaws, emergency patches coming tomorrow
  17. [17]BleepingComputer — Amazon says PHP2Shell exploitation began 4 days before patches
  18. [18]Cisco Talos — I had plans for that second
  19. [19]Dark Reading — Exposed to PHP2Shell? Cyber Experts Weigh in With Advice
  20. [20]The Record — Hundreds of websites taken offline as concern grows over two PHP vulnerabilities
  21. [21]Help Net Security
  22. [22]The Hacker News — URGENT - PHP Warns of Another Unpatched RCE Two Days After Emergency PHP2Shell Patches
  23. [23]The Hacker News — PHP2Shell: What Actually Protects You Before the 14:00 UTC PHP RCE Patch, and What Doesn't