Skip to content
BlogNews

News5 min read

PHP2Shell: a 14-year-old flaw that puts your website at risk

A flaw hidden in PHP since 2012 lets attackers take over web servers. What happened, why nobody saw it for 14 years, and what to do today.

Amine KHDev, Tradix Technology
00:00-06:03

What happened

PHP is the language behind a huge share of the web: WordPress, online shops, company websites, client areas, many internal tools. On October 21, its team published an emergency update for two flaws in PHP itself, not in a plugin or a theme.
Researchers named the pair PHP2Shell. In plain words: by sending specially crafted requests to your site, a stranger can end up running their own commands on your server, with no account and no password. Technically, that's an "unauthenticated remote code execution", rated 9.2 out of 10 by PHP's developers and 10 out of 10 by the firm watchTowr. (For your technical team: CVE-2026-109618 and CVE-2026-109619.)
The security firm watchTowr has already seen the flaws exploited in the wild, on the day the fix came out.

Fourteen years in plain sight

This is the part that struck me most. The faulty code shipped with PHP 5.4, in 2012. For fourteen years it sat in one of the most used programs on the planet: open source, read by thousands of developers, running on millions of servers. Nobody reported it.
I don't think that's because anyone was careless. I see three reasons.
The bug lives where nobody looks. One flaw is in what PHP does when it runs out of memory; the other in how it remembers the progress of a file upload between two visits. These are corners of a program that almost never run. As developers, we test what happens when things go right, a little of what happens when they go wrong, and almost never what happens when the machine itself is at its limit.
This kind of bug makes no noise. A wrong calculation shows a wrong number, and someone eventually notices. A memory bug shows nothing: the site keeps working, almost always. It only becomes dangerous when someone builds the exact conditions on purpose, and for that, you have to know it's there.
It wasn't worth anyone's effort. A flaw that is very hard to exploit can stay quiet for years, simply because attacking something easier is cheaper. That is what just changed.

Why it surfaced now

The flaws were found in August by researchers from Wiz, OpenAI and Calif, reported privately, and fixed quietly before the October announcement. That two months of silence is normal and healthy: it gave hosts time to prepare.
Look at the names, though: an AI company is among them. And Wiz's researchers wrote that frontier AI models "substantially reduced" the effort needed to turn this old flaw into a working attack.
For me, that is the real news, more than the flaw itself. For years, the main protection of old code wasn't that it was safe, but that attacking it was expensive. AI is lowering that cost for defenders and attackers alike. I expect more flaws like this one: old, deep, hidden for a decade, then exploited within days of being announced. The day a fix is published is now a starting gun, because the fix itself shows attackers where to look.

Are you affected?

An open padlock among scattered keyboard keys
Once a server runs an attacker’s code, everything on it is exposed.
Almost certainly, if your site runs on PHP, from version 5.4 to 8. That includes:
  1. WordPress, PrestaShop, Joomla, Drupal, Laravel or Symfony sites
  2. Shared hosting with cPanel or Plesk, where hundreds of sites share one server
  3. Internal tools written in PHP: intranets, HR portals, old ERP modules, client areas
In Algeria, that describes a large part of business websites: often WordPress, on shared hosting, built a few years ago by a freelancer who has since moved on. The site still works, so nobody looks at it. That is exactly the profile this flaw is waiting for.
If an attacker gets in, they can steal your customer data and emails, replace or take down your site, send spam in your name until your domain is blacklisted, or use your server to attack others.

What to do today

A server rack in a data centre
Only the update fully fixes PHP2Shell.
1. Find your PHP version. In cPanel, open "MultiPHP Manager" or "Select PHP Version". On your own server, your administrator runs php -v. If you don't know who manages your site, that is the first problem to solve.
2. Update to a fixed version: 8.2.35, 8.3.36, 8.4.27, 8.5.12 or newer. On shared hosting, your host has to do it: write to them today and ask for confirmation. Workarounds exist, but only the update fully fixes it.
3. On PHP 7 or 5? Plan the move now. No fix has been published for these versions. Your site stays open to PHP2Shell for good. "It still works" and "it is safe" are not the same thing.
4. Look for signs of intrusion: files you don't recognise on the server, new admin accounts, unusual slowness, or emails you never sent.
5. Keep a recent backup somewhere other than the server. If the worst happens, it's the difference between hours and weeks.

The real lesson

The lesson of PHP2Shell is not "PHP is dangerous": its team found, fixed and announced this properly. The lesson is that old doesn't mean proven. Code that has run without problems for fourteen years can still hide a door nobody has opened yet.
No website is perfect. The question is whether someone is watching yours, and how many hours they need to react when the next starting gun fires.
Share

Written by

Amine KH

Keep reading