PHP2Shell Vulnerability: What Happened and How to Patch PHP
Prefer to watch? Watch on YouTube · Subscribe for new builds · Read the transcript
On October 21st, governments switched off their own websites, Wikipedia went dark for about an hour, the Steam store threw errors, and Railway told every customer to rotate every key. In this video I explain what PHP2Shell is, how AI helped find it, which parts of the news were hype and which were real, and the 15-minute checklist I'd run on any app you ship. You don't need to be a security expert to follow it. If you build apps with AI and deploy them yourself, this one is for you.
What I cover in this video
- 0:00: The day the internet switched itself off, and how PHP2Shell works in plain English
- 1:32: Who found the bug, and how AI models from OpenAI and Google were involved
- 3:04: The leak, the deleted exploit video, and the fix shipping a day early
- 3:50: Governments, Wikipedia and Steam go dark
- 4:37: The viral headline that got the story wrong
- 5:22: Railway: a separate attack on the same day
- 6:08: The wider wave of attacks driven by AI agents
- 7:39: The 15-minute checklist so your app isn't next
What PHP2Shell is and who found it
PHP2Shell is two bugs in PHP itself, tracked as CVE-2026-109618 and CVE-2026-109619 and rated 9.2 out of 10, which counts as critical. That matters because PHP runs roughly 70% of websites (W3Techs puts it at 69.3% of sites with a known server-side language). WordPress, Wikipedia, online shops, forums and government sites all run on PHP.
Here's how the bugs work, in plain English:
- Bug one: An attacker sends a request designed to make PHP run out of memory right in the middle of reading form data. PHP stops halfway, and its cleanup code then treats that half-built data as if it were real.
- Bug two: A use-after-free. Memory from one request gets thrown away, but the next request on the same worker can still grab it.
Put the two together and someone who isn't even logged in can run their own code on your server. That's the "shell" in PHP2Shell. The bug isn't in WordPress or in your app. It's in PHP, and it had been hiding there for over a decade.
In August, a security firm called Calif found it while auditing PHP's code under OpenAI's Patch the Planet program. OpenAI says they used GPT-5.6 Sol. OpenAI's own security team reported the same root cause the same day. Later, Wiz found it again on their own using Gemini 4 Argon and GPT-5.6 Sol. That's three teams finding the same bug with AI models from OpenAI and Google. OpenAI says that, as far as it knows, AI found these bugs before attackers did. Calif also made a point I agree with: no model finds every bug from simple prompts. You still need people who know what they're doing.
The leak, the shutdowns, and the headline that got it wrong
The plan was to keep the bug quiet and ship the fix on October 22nd. That plan fell apart. On Tuesday morning, the bug numbers leaked in a Hacker News post that had the wrong date and the wrong score. That afternoon, Calif accidentally posted a video of its working exploit. They deleted it, but copies had already spread, so PHP moved the fix up a full day.
Cloudflare turned on firewall rules that blocked the attack for every customer, free plan included, about 9 hours before the bug was public. The patch landed around 7:00 a.m. Pacific, and within about 20 minutes security firms saw attackers trying it.
Then the shutdowns started. The UK's NCSC said that if you can't patch, you should consider taking the system offline:
- The Netherlands took down Rijksoverheid, MijnOverheid and DigiD, its national login.
- Finland took public government services offline. Denmark pulled its school platform, France took down prefecture sites, and Canada took some federal sites offline.
- BambooHR went down and said itself that the outage interrupts payroll. Pokémon and Nintendo online services went into emergency maintenance.
- Wikipedia went dark for about an hour for emergency PHP maintenance. About 30 minutes after the patch, the Steam store threw an error in the middle of Next Fest. Valve hasn't said why.
Later, Polymarket posted that Wikipedia, Steam and government websites had gone offline after OpenAI's model discovered critical flaws. The post went up around 4:30 in the afternoon, hours after Wikipedia and Steam were already back, and it got hundreds of thousands of views. The headline was right, but the story was wrong. Nothing got hacked, and there were no confirmed break-ins from PHP2Shell when I recorded this. The Dutch government said it had seen no signs of exploitation. Site owners took their sites offline on purpose, and that's the system doing its job.
Railway and the wave of AI-agent attacks
The same day, a completely different attack hit Railway, the platform a lot of us use to deploy apps. Railway saw unusual activity in the system that stores customer environment variables, where your API keys and database passwords live. Railway says someone may have accessed those encrypted variables and, for some of them, got the decrypted contents. In response, Railway paused builds across the platform, logged people out and revoked every API token. It told customers to rotate every environment variable and check their usage with their AI providers. There's no evidence this is connected to PHP. Railway believes it's part of a series of attacks on platform companies aimed at getting into AI providers, because AI keys are money: someone else's key means free compute on your card. I have two apps on Railway, Easy Flip and Magic Hand, so I spent the day revoking keys.
The bigger picture is why the day felt like the internet was melting. Starting in late September, one Chinese-speaking attacker pointed AI agents running Claude Code and DeepSeek through an open-source tool at more than 1,200 websites. About 100 companies were breached for roughly $5,000 in AI tokens, which researchers estimate at around $50 per breach. Last weekend, OpenCode co-founder Dax Raad said an AI had been attacking their systems non-stop for 48 hours. About 1.4% of OpenCode console users had their saved API keys exposed. OpenCode fought back with its own AI agents, and partway through, the defensive AI from OpenAI started refusing to help. OpenAI ended up refunding the affected users. In South Korea, attackers used a Chinese-built AI hacking tool plus Claude Code against several financial firms, exposing data on about 68,000 people. Fortune covered the wave. The same kind of AI that found PHP2Shell before attackers is now being used by attackers. Attacks used to take a team. Now one person with a token budget can do it.
The 15-minute checklist
- Update PHP itself. If anything you run uses PHP, move to 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Updating WordPress or your plugins doesn't do this. Check the version your web server is actually running, not just the one in your terminal, and restart every PHP worker. If you're on 8.1 or older, the advice is blunt: upgrade or take it offline.
- Put your site behind Cloudflare. Even the free plan blocked this attack by default. As Cloudflare said, that's a stopgap that buys you time. It doesn't fix the bug.
- Rotate your keys and set hard spend limits. If you were on Railway, rotate all of them. OpenAI lets you put a hard cap on a project, and Anthropic's console has monthly spend limits, so a leaked key can only cost you so much.
- Get secrets out of your code. Use a secret manager and turn on GitHub's push protection so you can't push a key by accident.
- Use AI on defense. Before you ship, run
/security-reviewin Claude Code. It reads your changes and flags vulnerabilities. - Have a second place to ship. A lot of Railway users couldn't redeploy to swap in their new keys. A backup deploy target means one platform's outage doesn't take your app down too.
Key takeaways
- PHP2Shell is a critical bug in PHP itself, not in WordPress or your app. Patch PHP and restart your workers.
- Most of the outages were deliberate, precautionary shutdowns. There were no confirmed PHP2Shell break-ins when I recorded this.
- The Railway breach is a separate incident. Rotate every environment variable and check your AI usage.
- AI helped find a bug that had been hiding for over a decade, and attackers now have the same tools.
- Spend limits, a secret manager, AI security reviews and a backup deploy target limit how bad a bad day can get.
FAQ
What is PHP2Shell?
PHP2Shell is two critical bugs in PHP itself (CVE-2026-109618 and CVE-2026-109619, rated 9.2). Combined, they let someone who isn't logged in run their own code on a server running PHP.
Which PHP versions fix PHP2Shell?
The fixed versions are 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Update PHP itself rather than just WordPress or plugins, check the version your web server is actually running, and restart every PHP worker. On 8.1 or older, upgrade or take the site offline.
Did hackers break into Wikipedia, Steam or government sites?
There were no confirmed PHP2Shell break-ins when I recorded the video. Most outages were sites taken offline on purpose to patch, and the Dutch government said it saw no signs of exploitation.
Is the Railway breach related to PHP2Shell?
No. Railway's breach is a separate attack on the system that stores customer environment variables, and there's no evidence it's connected to PHP. Railway advises rotating every environment variable and checking usage with your AI providers.
Chapters
- 0:00The day the internet switched itself off
- 0:35What PHP2Shell is (and how the bug works)
- 1:44AI found it first
- 2:27Join Shipping Skool (free)
- 2:41The leak and the scramble
- 3:44Governments, Wikipedia and Steam go dark
- 4:32Headline right, story wrong
- 5:08Railway: a different attack, same day
- 6:16The AI attack wave
- 7:34The fix: your 15-minute checklist
- 9:11Did AI break the internet?
Transcript
Read the full transcript
0:00Yesterday, the Dutch government switched off its own websites on purpose. Finland did it, too. Denmark, France, Canada. Wikipedia went dark for about an hour. The Steam store threw an error in the middle of Nextfest. Railway paused builds across its whole platform and told every customer to rotate every key. And the bug behind most of it was found with AI. So, in this video, we're breaking down what actually happened, what's hype, and what's real, and the 15-minute fix. So, it's not you next. Let's jump right into it. So, what actually happened? It's called PHP2 Shell. Two bugs in PHP, rated 9.2 out of 10, which is critical. And if you've
0:45never thought about PHP, here's why you should. PHP runs roughly 70% of websites by W3 text count. WordPress is PHP. Wikipedia runs on PHP. Shops, forums, government sites, PHP. Here's how it actually works in plain English. Bug number one. An attacker sends a request built to make PHP run out of memory at exactly the wrong moment, right in the middle of reading form data. PHP stops halfway and then its cleanup code trusts that half-built data like it's real. Bug number two is a use after free. Memory from one request gets thrown away, but the next request on that same worker can still grab it. Put them together and you get the scary part. Someone who isn't even logged in can run their own code on
1:32your server. That's the shell in PHP2 shell. And this isn't a bug in WordPress or your app. It's in PHP itself, and it's been hiding there for over a decade, which is insane. So, who found it? This is the part that's blowing up. In August, a security firm called Califf was auditing PHP's code under an OpenAI program called Patch the Planet and they found it. OpenAI says they used GPT 5.6 Soul. OpenAI's own security team reported the same root cause the same day. And then Whiz found it again on their own using Gemini 4 Argon and GPT 5.6 Soul. And Whiz gives Gemini a big shout out. So AI models from OpenAI and Google, three teams, same bug. OpenAI
2:19called it one of the most impactful security issues in recent memory and said that to their knowledge, AI found these before attackers did. Real quick, if you want to build stuff like this yourself, join Shipping School. It's free. 170 builders, a full video archive of how-tos, demos, and past recordings, and people who actually ship. The link is down below. Now, Califf said something I really like. No model is simply capable of unearthing all bugs with simple prompts. You still need people who know what they're doing. And then people made mistakes. The plan was simple. Keep it quiet. Ship the fix on October 22nd. Everybody patches. That's not what happened. On Tuesday morning, the bug numbers leaked in a post on
3:04Hacker News with the wrong date and the wrong score. That afternoon, Califf accidentally posted a video of its working exploit. They deleted it, but copies spread. So, PHP moved the fix up a full day. And this is where it gets wild. Cloudflare turned on firewall rules that blocked the attack for every customer, free plan included, about 9 hours before the bug was even public. Around 7:00 a.m. Pacific yesterday, the patch dropped. Cloudflare's CTO posted, "PHP changes are live. Start patching." And within about 20 minutes, security firms saw attackers trying it. No confirmed break-ins yet, but they were trying. Then governments started pulling the plug. The UK's cyber agency said, "If you can't patch, consider taking the
3:50system offline." The Netherlands took down Overhide, Mine Overhide, and Digid, their national login. Finland took public government services offline. Denmark pulled its school platform. France took down prefecture sites. Canada took some federal sites offline. Bamboo HR went down and they said it themselves. This interrupts payroll. And Pokemon and Nintendo online services went into emergency maintenance. Just before 8 a.m. Pacific, Wikipedia went dark for about an hour during Wikipdia's emergency PHP maintenance. And about 30 minutes after the patch, the Steam store threw an error right in the middle of Nextfest. Valve hasn't said why, but the timing is hard to ignore. So then Poly Market posts this. Wikipedia, Steam, and
4:37government websites go offline after OpenAI's AI model discovers critical security flaws. Hundreds of thousands of views. Here's something to be wary about. That post got the headline right and the story wrong. It went up around 4:30 in the afternoon, hours after Wikipedia and Steam were already back, and nothing got hacked. The Dutch government said it had no signs of anyone exploiting it. These sites didn't get broken into. their owners pulled the plug on purpose. And honestly, that's the system working. Now, the same day, a totally different attack. And this one hit me personally. Railway, the platform a lot of us use to deploy apps, saw unusual activity in the system that stores customer environment variables.
5:22That's where your API keys live, your database passwords. Railway says someone may have accessed those encrypted variables and for some of them got the decrypted contents. So they paused builds across the platform, logged people out, killed every API token and told every customer, "Rotate every single environment variable. Then go check your usage on OpenAI, Anthropic, and Grock." And there's no evidence this has anything to do with PHP. Different attack, same day. Railway believes it's part of a series of attacks on platform companies aimed at getting into AI providers. Why would anyone want your open AI key? Because AI keys are money. Someone else's key means free compute on your card. I've got two apps on Railway,
6:08Easy Flip and Magic Hand. So, I spent my day revoking keys. Not fun, but it's way better than a surprise bill. So, here's the bigger picture, and it's why yesterday felt like the world was melting. Starting in late September, one Chinese-speaking attacker pointed AI agents at more than 1,200 websites running Cloud Code and DeepSeek through an open- source tool called Kairen. About a 100 companies got breached, including Deer, Shark Ninja, and Cumins. The cost, roughly $5,000 in AI tokens. That's around 50 bucks a breach by the researchers estimate. Then, Open Code. Last weekend, co-founder Dax Rod posted that an AI had been non-stop trying to attack their systems for the past 48
6:53hours. About 1.4% of Open Code console users had their saved API keys exposed. And here's the crazy part. Open Code fought back with its own AI agents. And partway through, the defensive AI from OpenAI started refusing to help. Open AI ended up refunding the affected users. And in South Korea, attackers used a Chinese-built AI hacking tool plus cloud code against several financial firms. About 68,000 people's data exposed. So, the same AI that found PHP2 Shell before the bad guys is also being used by the bad guys. Attacks used to need a team. Now, it's one person and a token budget. So, oh my goodness, all of this happened. What do you actually do?
7:39Here's the 15-minute checklist. One, if anything you run uses PHP, update PHP itself. 8.5.12, 8.4.27, 8.36, or 8.2.35. Updating WordPress or your plugins does not do this. It's the PHP on your server. Then check the version your web server is actually running, not just your terminal, and restart every PHP worker. If you're on 8.1 or older, the advice is pretty blunt. upgrade or take it offline. Two, put your site behind Cloudflare. Even the free plan blocked this attack by default, but like Cloudflare said, it's a stop gap. It buys you time. It doesn't fix the bug. Three, rotate your keys. If you were on
8:26Railway, all of them. And then set hard spend limits. Open AAI lets you put a hard cap on a project, and Anthropics console has monthly spend limits. So, if a key does leak, the damage has a ceiling. Four, get your secrets out of your code. Use a secret manager and turn on GitHub's push protection, which blocks you from pushing a key by accident. Five, use AI on defense. Before you ship, run/security review in Claude Code. It reads your changes and flags vulnerabilities. If the attackers are using agents, you should be, too. And six, have a second place to ship. Yesterday, a lot of railway users couldn't even redeploy to swap in their new keys. A backup deploy target means one outage doesn't take you down with it. So, did AI break the internet? Not
9:14exactly. AI helped find a hole that's been hiding for over a decade, and the internet shut itself down to patch it. That's the good ending. The scary part is that attackers have the same tools. Now's the time to be a builder who actually locks the door. Comment down below. Would your app have survived yesterday? And if you want to learn how to build with all of this, join our free community, shipping school. The link is down below along with our free Discord. We'll see you in the next one. Have a blessed day.
Ready to start building with AI?
Join the Shipping Skool community free. Paid members get live bootcamp calls every week and weekly-updated courses.
Join Shipping SkoolKeep reading
Fable 5 Extended to July 12: Why It Happened and What to Build
Anthropic extended Fable 5 access in Claude subscription plans to midnight July 12, likely because OpenAI's next GPT models were expected that week. My advice: use the extra days to build your app and have Fable 5 refactor your codebase, fix bugs, and check for security issues before it moves to API pricing.
Claude Code Source Code Leak: What the npm Source Map Revealed
Anthropic shipped a source map file in its Claude Code npm package, which exposed the full original source: about 1,900 files and 512,000 lines of TypeScript. I explain how source maps work, what's inside (40 tools, a 46,000-line query engine, the unreleased Buddy and KAIROS features) and the build-pipeline lesson for builders.
What Can You Build with Claude Fable 5.2? Hardware, Games, Costs
People are using Claude Fable 5.2 to design circuit boards, build browser games from one prompt and render Blender films, but it cost more than Opus 5.5 in every side-by-side I found. I keep Opus 5.5 as my daily driver and run Fable on High for long, 3D and CAD jobs.
