Back to the feed
Explainers

PHP2Shell explained: the flaw in the code behind much of the web

Two critical flaws in PHP, the language behind sites like WordPress, could let attackers take over web servers without a password. A fix is out, and the NCSC is urging website owners to update now.

confirmedUpdated 22 Oct 2026 · 18:40 UK time
PHP2Shell explained: the flaw in the code behind much of the web cover image

What happened

On 21 October 2026, the team behind PHP released emergency fixes for two serious security flaws, tracked as CVE-2026-109618 and CVE-2026-109619. Researchers at Wiz have nicknamed the pair "PHP2Shell". PHP is the programming language that runs a huge number of websites, including WordPress, Drupal and Joomla.

The UK's National Cyber Security Centre (NCSC) published its own warning, telling organisations to act immediately. In its advice, any version of PHP may be affected, so everyone running it should update.

Why this one is a big deal

Most security flaws are in a single app or plugin. This one sits in PHP itself, the engine underneath. That means a website can be built carefully and still be exposed if the server behind it runs an affected version.

According to Wiz, the flaws could let an attacker run their own commands on a web server without logging in. Wiz says it demonstrated this on the latest versions of WordPress, Drupal and Joomla. It also reports that every PHP version from the last decade is affected by at least one of the bugs.

Wiz and the NCSC both describe the flaws as critical. Wiz gives them a severity score of 9.2 out of 10.

How it works, in plain English

Think of a web server as a busy kitchen, with each website visit being an order. PHP clears down the workstation after each order and gets ready for the next one.

Both flaws are about what happens when that tidy-up goes wrong:

  1. Running out of memory at the wrong moment. If PHP runs out of memory part way through setting up a request, it can be left with half-finished data. The clean-up then treats that broken data as if it were fine.
  2. Leftovers from the last order. In the second flaw, information from a previous visit can still be sitting in memory after it should have been wiped. The next visit handled by the same worker can end up using it.

In the wrong hands, these slips can be steered into running an attacker's code. Wiz also says some variants can leak memory belonging to other visitors, which could contain things like passwords, access tokens and API keys.

Who found it, and the role of AI

Wiz says its researchers found the first flaw in August, reported it to the PHP team in late August, and that PHP began working on a fix in September. Wiz thanks the PHP team, Calif and OpenAI for help with discovery, coordination and checking the patch.

Wiz also says advanced AI models helped with finding the bugs and with adapting attacks to different setups, which it argues lowers the skill needed to turn a flaw like this into a working attack. That is Wiz's own view of its research, not an independent finding.

Is it being used by criminals?

Wiz reports successful tests by its own researchers, but its write-up does not say whether the flaws have been used in real attacks. Amazon's threat intelligence team says its decoy servers recorded an attempt to exploit the flaw on 17 October, four days before the public announcement. Amazon believes the attempt came from a threat actor, but that is its assessment and not a confirmed finding. Beyond that single attempt, the wider scale of any attacks is not known.

Cloudflare has added protections to its firewall for known attack patterns, and says they are available to all customers, including free accounts. That helps, but Wiz says updating PHP is the only complete fix.

What we don't know yet

  • How many websites are actually vulnerable right now, and how many have been updated.
  • Whether attackers are using the flaws widely.
  • How the attacker behind the 17 October attempt knew enough to try it before the fixes were public.

You may see the claim that PHP powers 70 percent of websites. That figure comes from Wiz and no source was given for it, so treat it as an estimate.

What you can do

If you only browse the web, there is nothing to install on your phone or laptop. The fix has to be applied by whoever runs the website's server. Even so, a few sensible steps apply:

  • If you run a website, especially on WordPress, Drupal or Joomla, ask your hosting provider whether PHP has been updated, or update it yourself in your hosting control panel.
  • Versions that contain the fix are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, according to Help Net Security. PHP 8.1 and older no longer get updates, so move to a supported version.
  • If you use a managed host or website builder, check their status page or contact them. Most will apply the update for you.
  • If you cannot update straight away, the NCSC says to apply the temporary mitigations from the PHP Foundation, and to consider taking the site offline if you cannot.
  • Change reused passwords on accounts tied to a site you run if you think it could have been exposed, and turn on two-factor authentication wherever it is offered.
  • Be wary of follow-up scams. After big security stories, criminals often send fake "urgent update" emails. Report scam emails to report@phishing.gov.uk and scam texts to 7726.

Sources

NCSC: Critical security issue affecting PHPWiz: PHP2Shell, AI uncovers critical RCE vulnerabilitiesHelp Net Security: PHP2Shell, critical PHP vulnerabilities patchedCloudflare: protections against the php2shell vulnerability

Seen a scam? Report it.

Forward texts to 7726, emails to report@phishing.gov.uk, and report fraud to Report Fraud (formerly Action Fraud) on 0300 123 2040.