# PHP2Shell: what it means for your stack, and what to do now

> Two unauthenticated PHP remote code execution flaws, CVSS 9.2, about 22 million exposed instances and exploitation before the patch. A practical checklist for finding, patching and checking every PHP runtime you run.

Published October 28, 2026 by Antivenom · https://antivenom.ai/blog/php2shell-what-to-do

PHP2Shell is the name for two unauthenticated remote code execution flaws in PHP, rated CVSS 9.2. Unauthenticated means an attacker needs no account. Remote code execution means they can run their own code on your server.

Here is what we know, and a checklist for teams that run PHP anywhere.

## What happened

- The two flaws had gone undetected for more than ten years. They were [found with help from AI models](https://x.com/OpenAI/status/2112907856018309586) through OpenAI's Patch the Planet program.
- On October 20, 2026, watchTowr confirmed that the embargoed bug [had leaked before the patch](https://x.com/watchtowrcyber/status/2112611507749982605). The flaws were [exploited in the wild](https://www.bleepingcomputer.com/news/security/cisa-confirms-php2shell-vulnerabilities-now-exploited-in-attacks/).
- Palo Alto Networks counted [about 22 million exposed PHP instances](https://x.com/PaloAltoNtwks/status/2112944538620735551).
- The NSA's advice was blunt: [patch PHP now or take systems offline](https://x.com/cyber_razz/status/2112986024699896176). Governments [took websites offline](https://x.com/AFP/status/2112949134109872174) while they patched.

PHP runs a large share of the web, often in places nobody thinks about any more. That's what makes a bug like this dangerous.

## 1. Find every PHP runtime you run

Start with an inventory, and expect it to be longer than you think. As one engineer [joked that week](https://x.com/IT_unhinged/status/2112947445835727001), the inventory and reality rarely agree.

Look beyond the web servers you know about:

- **Container images.** Base images pinned to an old PHP tag keep shipping the old runtime, even after the host is patched.
- **Forgotten sites.** Old marketing sites, campaign microsites, staging copies and internal tools.
- **Managed and third-party hosting.** Shared hosting, agency-run sites and SaaS add-ons that run PHP on your domain.
- **Appliances and admin panels.** Some vendor products embed PHP for their web interface.

For each one, write down who owns it, whether it's reachable from the internet, and which PHP version is actually running. Check the running process or container, not the Dockerfile or the docs.

## 2. Patch from the official source, then verify

- Upgrade to the fixed release from [php.net](https://www.php.net/) or your distribution's security updates.
- For containers, rebuild on a patched base image and redeploy. Pulling a new image does nothing if your tags are pinned to an old version.
- Verify the version **inside the running workload** after the deploy. A patch isn't done until production reports the new version.

## 3. If you can't patch today, take it off the internet

This is what the NSA's "patch or take offline" means in practice:

- Put the app behind a VPN or an authentication layer, or block it at the edge.
- Use your WAF vendor's rules for PHP2Shell as a stopgap, not a fix. Attackers adapt payloads faster than signatures ship.
- If nobody can say what an old PHP app is for, that is your answer. Turn it off.

## 4. Assume anything exposed during the window may be compromised

The bug leaked before the patch, and exploitation started in the wild. For every PHP app that was reachable from the internet before you patched:

- Look for new or changed files in web roots and upload folders.
- Look for unexpected processes started by the web server or PHP-FPM user, and new scheduled jobs.
- Check for unusual outbound connections from those hosts.
- Rotate every secret the app could read: database passwords, API keys and cloud credentials in its environment or config files.

If you find signs of compromise, treat it as an incident: isolate the host, keep evidence and rebuild from a clean image rather than cleaning in place.

## 5. Shrink the next window

PHP2Shell won't be the last decade-old bug that AI helps someone find. The teams that had the easiest week were the ones that:

- already knew where every PHP runtime lived,
- could rebuild and redeploy everything in hours, not weeks,
- had already retired the apps nobody used.

That's the real lesson. Every exposed service gets checked now, so the gap between "a fix exists" and "production is fixed" is where the risk lives. We wrote more about why in [Black October: one week that showed what AI-speed attacks look like](https://antivenom.ai/blog/black-october-2026).
