🔍 Case Studies

PHP2Shell explained: the AI-found PHP flaws that took government websites offline

In October 2026, researchers using AI found two critical flaws in PHP, the language behind much of the web, and governments pulled sites offline. How the flaws work, who is affected and what to do.

Case Studies: PHP2Shell explained: the AI-found PHP flaws that took government websites offline

In short

On October 21, 2026, the PHP project released urgent fixes for two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619, nicknamed PHP2Shell. PHP is the programming language that runs a huge share of websites, including those built on WordPress, Drupal and Joomla. The flaws can let an attacker take control of a web server without logging in.

Cyber security agencies told organizations that could not update right away to take affected systems offline. Several did, including government websites in Finland and the Netherlands. On October 26, the US Cybersecurity and Infrastructure Security Agency (CISA) added both flaws to its list of vulnerabilities known to be used in real attacks.

The researchers say frontier AI models were central to finding the bugs and proving they could be exploited. For regular internet users, there is nothing to install. For anyone who runs a website, the fix is to make sure PHP is updated to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or a vendor patched equivalent.

What PHP is, and why one flaw matters so much

When you open a web page, a server somewhere builds that page for you. On a large share of websites, the software doing that work is written in PHP. Wiz, one of the research firms involved, estimates PHP powers about 70% of websites. That figure is Wiz's own estimate, and the BBC noted it could not verify it, but nobody disputes that PHP is everywhere.

Most website security problems live in one site's own code or in one plugin. PHP2Shell is different. The bugs are in PHP itself, underneath every application that runs on it. Wiz says even a simple "Hello World" page on an affected PHP version could be vulnerable. The NSA put it plainly: the flaws are in PHP, not in the hosted application or its configuration.

That is why the response was so broad.

How the flaws work, in simple terms

You do not need to be a programmer to follow the basic idea.

A busy website reuses the same worker programs to handle request after request, like a restaurant reusing the same tables for one guest after another. Normally, after each guest leaves, the table is fully cleared.

PHP2Shell abuses a moment when that clean up goes wrong. According to the PHP project and Wiz:

  1. An attacker sends a specially built request that makes PHP run out of memory partway through starting up.
  2. PHP abandons that request, but some notes about it are left behind pointing to memory that has already been freed. In our restaurant picture, the old guest's order slip is still on the table.
  3. The attacker sends a second request to the same worker. That worker trusts the leftover notes and reads or writes memory the attacker now controls.
  4. With careful setup, this lets the attacker read secrets from the server's memory, such as passwords, tokens and keys, or run their own commands on the server.

The PHP project grouped the issues into two CVEs: one about out of memory handling leaving data half set up, and one about state surviving after its memory was freed. Wiz demonstrated full takeovers of WordPress, Drupal and Joomla test sites without logging in. CVSS, the standard severity score, rates them 9.2 out of 10.

The PHP project says every installation serving web requests is at risk, and it considers sites running PHP through Apache's mod_php the highest risk.

Timeline

Date (2026) What happened
August 19 Wiz finds the first vulnerability using AI models and its own tools
August 24 Wiz reports the issues to the PHP security team
October 20 Details leak on social media before the planned release, according to the BBC
October 21 PHP releases fixed versions; CISA, NSA, the UK NCSC and others issue alerts
October 21 Government sites in several countries go offline as a precaution
October 23 CISA adds a detection rule and more guidance
October 26 CISA adds both CVEs to its Known Exploited Vulnerabilities catalog

Why government websites went offline

Agencies gave unusually blunt advice. The NSA said that if an immediate update is not feasible, organizations should take the system offline until it can be fully mitigated. CISA said the same for anyone who cannot update or is still on PHP 8.1 or earlier.

Many operators followed it. The BBC reported that Finland temporarily shut down the government's public web services, the Dutch national cyber security agency took its own site offline, and pages run by a Dutch public health institute, the Dutch parliament's lower house, Edinburgh council and some BBC programmes became unavailable. Wikimedia, which runs Wikipedia, took some systems down as a precaution.

This was a deliberate trade off: a few hours or days of downtime against the risk of a server being taken over. The BBC noted that some of the affected organizations had not confirmed the outage was linked to PHP.

The AI angle

Wiz says the flaws had been in PHP's code for more than a decade, and some issues affect versions going back to PHP 5.4. What stopped people from exploiting them was complexity. Turning the bugs into a working attack meant chaining several weaknesses and adjusting for each server's memory layout.

According to Wiz, frontier AI models made that work practical, letting researchers build and adapt working exploits across several applications in hours. It credits Google's Gemini 4 Argon and OpenAI's GPT-5.6 Sol, alongside its own research tool. Wiz argues that this changes the economics of security: bugs once thought too hard to exploit may now be within reach.

That cuts both ways. The same tools helped defenders find, fix and verify the patch before attackers did, and companies such as Cloudflare, Fastly, Google Cloud and AWS prepared protections in advance. But it also means the time between a fix being published and attackers using it is likely to keep shrinking.

Who is affected

You are... Are you affected? What to do
Someone who visits websites Not directly. Nothing runs on your device Watch for breach notices; use unique passwords and two factor authentication
A small site owner with managed hosting Possibly, depending on your host's PHP version Ask your host to confirm PHP is patched; update your CMS and plugins
Someone who runs their own server Yes, if PHP serves web requests Update to a fixed version now; check logs for signs of compromise
An organization on PHP 8.1 or older Yes, and the PHP project no longer issues fixes Get a vendor backport, upgrade, or take the site offline

What website owners should do

  1. Find every place PHP runs. CISA notes that PHP often sits inside other products, so it is easy to miss. Think control panels, intranet tools and appliances, not just the main website.
  2. Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your Linux distribution's patched package. The PHP project says distributions received the patches in advance.
  3. Prioritize anything on the public internet, then everything else.
  4. If you cannot update yet, use a web application firewall and the PHP project's temporary settings, but treat them as stopgaps. PHP says only the update is a complete solution.
  5. Look for signs of compromise. CISA suggests watching for PHP worker processes launching shells or downloading tools. If you find any, assume stolen passwords and keys, and rotate them.
  6. If you use managed hosting, ask your provider in writing whether PHP has been patched, and keep WordPress and plugins current.

What regular internet users should do

There is no update to install on your phone or computer for this one. The risk is to the websites you use. Sensible steps:

What PHP2Shell did not affect

It helps to be clear about the limits, so the story does not cause more worry than it should.

  • Your phone and computer are not running vulnerable PHP just because you browse websites. PHP runs on the server that builds the page, not in your browser.
  • Websites built without PHP, for example many sites made with other languages or served as plain files, were not exposed by these two flaws.
  • A site going offline is not proof it was hacked. Many operators took sites down as a precaution while they patched, exactly as agencies advised.
  • Updated servers are protected. The PHP project says its fix removes the underlying problem, including other variants of the same bug pattern.

Lessons

Shared foundations carry shared risk. Like Heartbleed in 2014 and Log4Shell in 2021, PHP2Shell sat in a component that millions of systems rely on without thinking about it.

Knowing what you run is half the battle. The organizations that moved fastest were the ones that already knew where PHP was installed.

Patch speed matters more than ever. If AI shortens the time needed to build an exploit, the safe window between a fix and an attack shrinks too. The same rule applies on a smaller scale to your own devices: turn on automatic updates.

Calm, early action works. Taking a site offline for a day looks dramatic, but it is far cheaper than cleaning up after a takeover.

Frequently asked questions

What is PHP2Shell?

PHP2Shell is the nickname for two critical vulnerabilities in the PHP programming language, CVE-2026-109618 and CVE-2026-109619, disclosed on October 21, 2026. They can let an attacker run code on a web server without logging in.

Which PHP versions fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older no longer get official updates, although some Linux distributions and support vendors provide backported fixes.

Is PHP2Shell being exploited?

Yes. CISA added both vulnerabilities to its Known Exploited Vulnerabilities catalog on October 26, 2026, which means it has evidence of real attacks.

I just use websites. Do I need to do anything?

There is nothing to install on your own phone or computer. Watch for breach notices from services you use, change any password a site says may be exposed, and use unique passwords with two factor authentication.

My website runs on WordPress with a hosting company. Am I affected?

Probably, if your host runs an unpatched PHP version. WordPress, Drupal and Joomla all run on PHP. Check with your host that PHP has been updated, and update WordPress and plugins too.

How was AI involved?

Wiz says it used frontier AI models alongside its own tools to find the flaws and build working exploits. The underlying bugs had been in PHP for more than a decade.

Sources

  1. PHP: News Archive 2026 (security release of October 21, 2026)
  2. CISA: Critical Vulnerabilities in PHP Require Immediate Patching
  3. NSA: NSA Advisory: Critical Patches Recommended for PHP Vulnerabilities
  4. Wiz: PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet
  5. BBC News: Websites taken down worldwide as critical PHP cyber-security update issued