PHP2Shell, in plain English: what the PHP bug actually means for your site
On 21 October 2026 at two o'clock in the afternoon UTC, the PHP project released four versions at once and told everybody running a website to stop what they were doing and update.
They do not normally do that. PHP ships security fixes on a schedule, quietly, the way most software does. This time they published an advance warning the evening before, because the details had already leaked, and the fix was still eighteen hours away.
The bug got called PHP2Shell. Two bugs, really: CVE-2026-109618 and CVE-2026-109619. If you run a website, somebody has probably already told you to patch. This is the part nobody told you: what it actually is, who it actually hurt, and which of the frightening numbers you read last week were real.
How far back it goes

The vulnerable code reaches back to PHP 5.4. That version is old enough to have been current when Instagram still had a chronological feed.
I want to be careful with that, because a lot of coverage turned it into a headline number. CNN went with "22 years." I cannot find a source for that, and neither could anyone I checked with. No researcher has named the commit that introduced the flaw or the year it landed. What the researchers actually say is that the earliest affected code path dates to 5.4, and that the work was inspired by Stefan Esser's memory-limit research from 2004. Those are two different things, and somewhere in the retelling they got welded together.
So: old. Older than most of the websites running it. Precisely how old, nobody has established.
Who found it, and how they found it

Two teams, independently, within weeks of each other.
The first was Calif, a small security outfit, working under a programme called Patch the Planet that OpenAI funds. Ryan Austin started auditing PHP's memory handling on 30 July 2026. By 1 August he had found the first way to make PHP fall over. By 11 August he had reported it.
The second was Wiz, a cloud security company. Sagi Tzadik and colleagues found their way in around 19 August, had unauthenticated remote code execution working against Drupal by the 20th and WordPress by the 21st, and reported it on the 24th.
Here is the part that makes this story a milestone rather than just another CVE. Both teams used large language models to find it. Not fuzzing, which is the usual automated approach of throwing random garbage at a program until it crashes. They used AI to read the code and reason about it.
Austin is refreshingly unsentimental about what that means. In his own words:
"No special harness, or access to models that weren't generally available to everyone were used in the initial bug discovery."
And, pushing back on the obvious over-claim:
"No model is simply capable of unearthing 'all bugs' with simple prompts."
So this was not a robot finding a bug on its own. It was a skilled researcher using a model to read far more code, far faster, than a person can. That distinction will get flattened in a lot of commentary. It shouldn't be.
Wiz credits Gemini 4 Argon with "an invaluable contribution." Nobody has disclosed whether a bounty was paid to anyone.
What the bug actually does
This part sounds complicated and isn't.

Your web server does not start a fresh copy of PHP for every visitor. That would be hopelessly slow. Instead it keeps a pool of workers running, and each worker handles one request after another, thousands of times a day. Think of a worker as a desk that gets cleared between jobs.
Both bugs are ways of leaving something behind on that desk.
CVE-2026-109618 is about running out of memory at exactly the wrong moment. An attacker sends a request designed to exhaust PHP's memory allowance while PHP is still halfway through setting up. PHP bails out, but the clean-up routine does not realise the setup never finished, and starts tidying away things that were never properly put out. PHP's own description: out-of-memory handling "can interrupt PHP while internal request data is only partially initialized. Request cleanup may then treat the invalid data as valid."
CVE-2026-109619 is about leftovers. PHP keeps some notes about the current request in places that outlive the request itself. Those notes are supposed to be wiped before the memory they point at is reused. Sometimes they aren't. A second request, landing on the same worker, can be made to act on them.
Neither bug needs a password. Neither needs the visitor to click anything. On a default Apache configuration, both work.
What an attacker could actually do with it
The short answer is: anything the web server can do.
That phrase does a lot of work, so let me unpack it. A successful attack gives someone a shell on your machine. That means a command prompt, running as whichever user your web server runs as, on the box your site lives on. From there they can read every file that user can read, which on a typical setup includes your database password, your API keys, your customers' data, and the contents of your .env file. They can write new files, which means uploading a backdoor that survives after you patch. They can send email from your domain, which is how a small charity ends up on a spam blocklist and spends the next three months explaining to Google why its donation receipts should reach anyone's inbox. They can mine cryptocurrency on your bill.
Separately, Wiz demonstrated a quieter version: a crafted cookie that leaks chunks of the worker's memory back to the attacker. Passwords and tokens belonging to other visitors who happened to use the same worker. No shell required, no obvious trace in your logs.
The researchers demonstrated unauthenticated code execution against current versions of WordPress, Drupal, Joomla, MediaWiki, Roundcube, Magento, phpMyAdmin, Nextcloud, Laravel and Symfony. Not against bugs in those applications. Against the PHP underneath all of them.
Who actually got hurt
Now for the part where I disagree with most of what was published last week.

You read that there were millions of attacks. That figure came from Cloudflare, via a post on X, and nowhere does anyone define what was counted. Requests? Blocked requests? Scans? Unique sources? A single automated scanner sweeping the internet generates millions of anything. Cloudflare also sells the firewall rules that block this, which does not make the number wrong, but does mean nobody checked it.
Here is what has actually been confirmed, by name, with published data.
Amazon's honeypot network logged one exploit attempt on 17 October, four days before the patch existed. Amazon's own assessment: "it's unclear if any of these attempts would have succeeded in real-world systems."
On 24 October, a researcher called Adel Karimi published packet captures showing 35 confirmed shells across three honeypots, from two source addresses. That is the first and, at the time of writing, the only confirmed code execution anywhere in public. His honeypots were running PHP 8.4.26 on Apache with a single worker, which is about the most cooperative configuration an attacker could hope for. He says so himself: the data "is not a measurement of exploit reliability on other worker counts, PHP builds, or applications."
Meanwhile Red Hat argues that reliable exploitation needs precise memory manipulation and timing, and that on standard PHP-FPM setups the worker tends to die before an attacker gets anywhere. Palo Alto's Unit 42 published a story on 23 October linking a European government breach to PHP2Shell, then retracted it on the 25th, saying it could not confirm the connection.
None of this means the bug was overhyped. It was a genuine unauthenticated remote code execution in the most widely deployed server-side language on earth, and patching immediately was the right call. But "millions of attacks" and "millions of compromised sites" are not the same sentence, and a lot of people read the first and heard the second.
The people who got genuinely hurt are a smaller and much less visible group. Which brings me to the real problem.
How much of the web is this, actually?

Almost every article last week said PHP powers 70% of the internet. That number is wrong, and it is wrong in an interesting way.
W3Techs, the source everybody is quoting, says this: "PHP is used by 69.2% of all the websites whose server-side programming language we know."
Read the last six words again. It is not 69% of all websites. It is 69% of the subset where W3Techs could identify the language at all, from a sample of roughly 20 million ranked sites, chosen using Google's Chrome user data and the Tranco list, with parked domains and empty pages filtered out. That is a serious, well-documented methodology. It is just not a census of the internet, and the qualifier got dropped somewhere around the first security vendor's blog post and never came back.
The accurate version is still enormous. PHP is the dominant server-side language by a distance, WordPress alone accounts for 39.6% of all websites, and every WordPress site is a PHP site.
But here is the number that actually matters for this story. Of all the sites running PHP: 26.7% are on PHP 7, 7.7% are on PHP 5, and 0.1% are still on PHP 4. That is 34.5% sitting on a major version that is completely end-of-life and will never receive this fix. And 34.5% is the floor, not the total, because PHP 8.0 died in November 2023 and PHP 8.1 died in December 2025, and both are hiding inside the 65.5% "version 8" slice. W3Techs does not publish a free breakdown within version 8, so nobody can tell you the real figure.
A separate measurement, from a completely different method, lands in the same territory: VulnCheck puts roughly 42% of internet-facing PHP hosts on branches with no official patched release.
So the honest answer to "who got totally affected" is this. Not the big sites, which patched within hours. The people who got left behind are the ones running a site somebody built for them in 2017 and nobody has touched since. The parish website. The small manufacturer's catalogue. The restaurant that paid a freelancer four thousand rupees and never heard from them again. Those sites are running PHP 7.4 on shared hosting, they will never be patched, and nobody is going to write a news story when one of them starts sending spam.
What to do, in order

PHP's own guidance is one sentence, and it appears in all four release announcements: "There are no complete mitigations, updating is the only safe choice."

Run php -v on your server, or ask your host. If you are below the version in that table, you are running vulnerable code.
One wrinkle that trips people up. Debian, Ubuntu, Red Hat and cPanel all backport security fixes without changing the version number. A server reporting PHP 8.2.20 from a distribution package may well be patched. Check your vendor's advisory rather than the number alone.
If you genuinely cannot patch today, PHP published a list of stopgaps. Two are worth knowing even if you have patched:
Set session.upload_progress.enabled=0 and restart every worker. This closes the confirmed path for the second bug, and it also covers a related issue, CVE-2026-115560, that is still unpatched and scheduled for the next routine release.
And one counterintuitive warning, straight from the advisory: do not use RLIMIT_AS or RLIMIT_DATA to cap memory. They cause exactly the kind of allocation failure that triggers the vulnerable code path. A reasonable-sounding hardening measure makes this bug easier, not harder.
If your site was reachable from the internet and unpatched between 21 and 24 October, patching does not undo a compromise. Look for PHP files you did not create, cron jobs you did not schedule, admin users you do not recognise, and outbound connections from your web server to places it has no business talking to.
Is PHP still worth building on?

Yes, and I say that as someone who has spent the last fifteen hundred words describing its worst week in years.
Three reasons, none of them sentimental.
The response was fast and it was honest. Reported in August, coordinated disclosure, four branches patched simultaneously, an advance warning when the embargo broke, source-only backports for three end-of-life branches that had no obligation to receive anything, and an advisory that tells you plainly that the mitigations do not make you safe. Compare that to vendors who ship a quiet patch and let you find out from a scanner.
The tooling is genuinely good now. Modern PHP with types, Composer, PHPStan at level 9 and a decent framework is a perfectly respectable way to build software, and the performance since PHP 8 is nothing like the PHP people remember from 2012.
And the hosting economics are unbeatable at the small end. You can put a PHP site on five-dollar-a-month shared hosting. That is precisely why 69% of identifiable sites run it, and precisely why a third of them will never be patched. The same property produces both facts.
This is not really a PHP problem

Here is the uncomfortable part, and the reason I would not switch languages over this.
PHP's interpreter is written in C. So is Python's. So is Ruby's. So is Node's underlying V8 engine, in C++. Memory-safety bugs of exactly this shape have shown up in all of them, and will again. The specific flaw was PHP's. The category belongs to an entire generation of infrastructure.
What changed in August 2026 is not that PHP got worse. It is that two teams pointed language models at a large C codebase and found something humans had walked past for more than a decade. That capability is now available to everybody, including people who will not be filing a coordinated disclosure.
So the thing to take from this is not "move off PHP." It is that the gap between a bug existing and a bug being found is collapsing, across every language, and your plan should assume you will be patching more often rather than less.
What that means in practice, whatever you build in:
- Know what you are running. You cannot patch software you do not know you have.
- Prefer boring, supported versions over interesting, abandoned ones.
- Run the web server as a user with as little access as you can tolerate.
- Keep secrets out of the filesystem the web server can read.
- Have somewhere to look when you need to know what happened last Tuesday.
How to deploy so the next one hurts less

The sites that came through this fine were not the ones with the cleverest firewall. They were the ones that could patch in an afternoon without asking permission.
That is a deployment property, not a security product. It is also the single thing on this page that would have protected you against a bug nobody had heard of yet, which is the only kind of protection worth paying for, because every piece of advice in this article is a reaction to something that already happened. Five things make it true:
Containers with a pinned base image. When the fix lands, you change one line, rebuild, redeploy. Snowflake servers configured by hand in 2019 are the ones still unpatched today.
A pipeline you trust enough to use in a hurry. If deploying is scary, you will delay, and the delay is the vulnerability. The test suite exists so you can ship on a Tuesday afternoon during an incident.
Automatic security updates on the OS layer, with a reboot window you actually honour.
Something watching your dependencies. Dependabot, Renovate, whatever your host offers. Free, and it turns "I read about it in the news" into a pull request.
A WAF, last and least. Cloudflare pushed rules to every customer including the free tier within hours, and described them in its own words as a stopgap. They only see traffic that routes through them, and anyone who finds your origin server's address goes around them entirely. Useful. Not a plan.
If your current deployment process is SFTP and hope, that is the thing to fix. Not the language.
The bit nobody can answer yet
We still do not know how many sites were actually compromised.
Not roughly. Not within an order of magnitude. The confirmed total in public is 35 shells on three honeypots that were deliberately configured to be easy. The scanning numbers are in the millions and measure something else entirely. Somewhere between those two figures is the truth, and the data to find it does not exist, because the sites most likely to have been hit are the ones with nobody watching the logs.
I suspect we will never get a number. Breaches on small sites rarely get reported. The people running PHP 7.4 on shared hosting in 2026 are not writing incident post-mortems.
If you patched last week, you are fine. If you are reading this and still have not checked, go and run php -v now. It takes four seconds and I will wait.
Sources
- php.net release archive, October 2026 — the 21 October security releases, the advisory text, the full mitigation list, and the 23 October note on CVE-2026-115560
- php.net security advisory, 21 October 2026 — "There are no complete mitigations, updating is the only safe choice," and the warning against
RLIMIT_AS/RLIMIT_DATA - php.net supported-versions — branch support dates, including PHP 8.2 reaching end-of-life on 31 December 2026
- Calif's own write-up — discovery timeline from 30 July, the quotes on LLM-assisted discovery
- Wiz research blog — the independent discovery, the memory-disclosure cookie, demonstrated RCE on WordPress, Drupal and Joomla
- Adel Karimi, honeypot report, 24 October 2026 — 35 confirmed shells across three honeypots from two addresses, PHP 8.4.26 on Apache mod_php with a single worker, and the author's own stated limits
- Amazon Threat Intelligence (MadPot) — the 17 October pre-disclosure attempt, and "it's unclear if any of these attempts would have succeeded in real-world systems"
- W3Techs, 26 October 2026 — "PHP is used by 69.2% of all the websites whose server-side programming language we know," the version breakdown, WordPress at 39.6% of all websites, and the sampling methodology
- VulnCheck exposure analysis, 23 October 2026 — internet-facing PHP host counts and the end-of-life share
- Censys exposure data, 23 October 2026 — 4,184,559 hosts running a PHP service, which is a count of PHP hosts and not of vulnerable ones
Figures not used, and why: Palo Alto Cortex Xpanse's "22.6 million exposed instances" is an order of magnitude above every other count with no stated unit; Tenable's ">1.3 million" is described by Tenable itself as a rough estimate with no method; CNN's "22 years" could not be traced to any source; and Unit 42's European government agency compromise was retracted on 25 October.
