22 Oct 2026 · 4 min read
Two critical PHP vulnerabilities, nicknamed php2shell, let anyone take over a website with a single request
Is this one serious?
That was the message on my screen on Wednesday evening, with a link to a tweet. Two critical vulnerabilities in PHP. Patches coming the next day. Rated 9.2 out of 10.
Yes. This one was serious.
First, what PHP is
PHP is the engine behind most of the web. When you open a WordPress blog, fill in a form or log in to a shop, there is a good chance PHP is running on the server, building the page you see.
So when PHP itself has a hole, it isn't one website's problem. It's everybody's.
What happened
Two bugs were found in PHP's core, called CVE-2026-109618 and CVE-2026-109619. People started calling them php2shell.
Both allow remote code execution. In plain words: a stranger anywhere in the world can send one specially crafted request to your website and make your server run their commands. No password. No login. And it happens before your website's own code even starts, so it doesn't matter how carefully your site is built.
The bugs were meant to stay secret until the fix was ready. They didn't. The bug IDs leaked online on 20 October, a researcher's demo video slipped out by mistake, and the PHP team moved the release forward a day to beat the attackers. On 21 October at 14:00 UTC, the fixes went out.
How the bug works
Here is the simplest way I can explain it.
Bug one is a half-packed suitcase. Imagine you're packing a suitcase and the fire alarm goes off. You drop everything and run. Later, you grab the suitcase assuming it's ready, and you trust whatever is inside.
PHP had the same habit. When it ran out of memory in the middle of a job, it did an emergency stop, which PHP developers call a bailout. It jumped out halfway through building something, and later treated that half-built thing as if it were complete. An attacker could make PHP run out of memory at exactly the wrong moment, and sneak their own contents into the suitcase.
Bug two is a hotel room nobody cleaned. PHP handles visitors one after another, like guests in a hotel room. Between guests, the room should be cleaned. Sometimes it wasn't: a few of the previous guest's things were left behind, and the next guest used them.
An attacker could check in, leave something poisoned in the room, and then send a second request that picked it up.
What the fix does
I was curious, so I looked at the actual change in PHP's code. It's one large fix across almost a hundred files, and the idea fits in two lines:
- No more running out mid-packing. When memory runs out, PHP now unwinds calmly, finishing or undoing each step, instead of jumping out and leaving a mess.
- Clean the room every time. PHP now properly resets its internal state before the next visitor.
That's also why no setting can fully replace the update. The flaw is in the engine, so the engine itself has to be replaced.
What to check on your own sites
- Find your PHP version. On a server, run
php -v. On managed hosting, look in your control panel. - Compare it with the fixed versions: 8.2.35, 8.3.36, 8.4.27 and 8.5.12, or newer. Anything below those is still vulnerable.
- If you're on PHP 8.1 or older, move up. Those versions are end of life and get no official fix. Upgrade to 8.2 or newer, and test your site after.
- On managed hosting, your host installs the patch, not you. Check their status page and confirm with support. Your job is making sure every site is on a supported version.
- Until the patch lands, a firewall like Cloudflare helps, and PHP's advisory lists temporary settings. They narrow the door; they don't close it.
- Look for anything odd. Strange
.phpfiles in upload folders, files you didn't change, processes you don't recognise. Attackers usually leave something behind.
But here's the thing
The scary part of php2shell wasn't the bug. Bugs happen in every piece of software.
The scary part was the old version nobody remembered. The test site from two years ago. The app still on PHP 7.4 because "it works, don't touch it". Those are the ones that never get updated, and those are the doors attackers walk through.
That night, the most useful thing I did wasn't clever. It was making a list: every server, every site, every PHP version. You can't protect what you don't know you have.
Know what you're running.
Keep it on a version that still gets fixes.
And when the next one comes,
you'll only have to check a list,
not panic in the dark.
— Farooq
October 2026