Two critical security flaws in PHP, the programming language that quietly runs a huge share of the world's websites, have set off one of the biggest emergency patching efforts in years. What makes this one different is how the flaws were found. Researchers say frontier AI models were what turned a bug that had sat in PHP for years into a working attack.

The PHP project released fixed versions, PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, on Wednesday 21 October at 14:00 UTC (3pm UK time). The two bugs, tracked as CVE-2026-109618 and CVE-2026-109619 and nicknamed "PHP2Shell", are each rated 9.2 out of 10 for severity. Either one can let an attacker who has not logged in run their own code on a web server.

What is PHP, and why does this matter?

PHP is the language that sits behind WordPress, Drupal, Joomla and Magento, as well as countless shared hosting accounts, control panels and business systems. Most people never see it, but it builds the pages they read. Security firm Wiz estimates "roughly 70%" of the internet is affected, although the BBC said it could not verify that figure.

Because the flaws sit in PHP's engine rather than in any one website's code, even a simple page on a vulnerable server can be attacked. According to the PHP Foundation, one bug lets a request that hits PHP's memory limit at exactly the wrong moment corrupt memory. On Apache servers using mod_php, that can be triggered before any of the site's own code runs. The second leaves behind stale data from an earlier request that a later request can misuse.

How AI found it

This is where the story becomes an AI story. The PHP Foundation says one of its developers first spotted signs of the memory problem in 2024, during an external security audit, but nobody could show a realistic way to exploit it, and work on a fix repeatedly stalled. The Foundation calls that delay "a structural failure".

That changed this summer. Through OpenAI's "Patch the Planet" programme, which gives security teams access to the company's most advanced tools, the firm Calif began auditing PHP on 30 July. On 11 August a Calif researcher reported a full remote code execution flaw with the same root cause. OpenAI independently reported it the same day, and Wiz found further ways in on 24 August.

Wiz called these "among the most severe vulnerabilities discovered in PHP, and arguably in software history". It said exploiting them required "an exceptionally complex chain of steps, at the edge of what human researchers could practically achieve", and that frontier AI models "substantially reduced that barrier". OpenAI described the discovery as "one of the most impactful security issues in recent memory".

The PHP Foundation is also clear about the other side. It has published 15 security fixes since 1 July and waded through more than 100 reports that were invalid, duplicates or could not be reproduced, many of them AI-assisted. AI helps sort them, it says, but a person still makes every call and writes every patch.

A leak, a rushed release and early attacks

The release was meant to happen on 22 October. On the afternoon of 20 October the two CVE numbers began circulating online, with an inflated score of 10.0, so PHP brought its release forward by a day. Calif then mistakenly published a video showing its proof of concept, and the Foundation says copies helped others build their own exploits. The Foundation also criticised Chainguard, a software supplier, for publishing fixed builds more than six hours before the agreed release time.

Attackers did not wait. Cloudflare's chief technology officer, Dane Knecht, said the company was "seeing early attacks emerging". Amazon's threat intelligence team says its honeypot network recorded an exploitation attempt on 17 October, four days before public disclosure, and security firm Tenable reports that the bugs are now being broadly exploited.

Sites pulled offline, including in the UK

Several governments told organisations that could not patch quickly to take systems offline. The UK's National Cyber Security Centre said: "Where immediate remediation is not feasible, organisations should consider taking the system offline until it can be fully mitigated." The US National Security Agency gave similar advice.

Finland temporarily shut down its government's public web services and the Dutch cyber security agency took its own site down. In the UK, Edinburgh council's website became inaccessible, as did sites for several BBC programmes, though neither confirmed a link to PHP. The BBC later reported that councils and NHS boards had taken websites offline after the alert. Wikipedia's operator said it had taken some systems down as a precaution.

What you should do

If you run a website, find out whether it uses PHP. Most WordPress sites do. If you manage your own server, update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or install your Linux distribution's patched package. If you use a hosting company, check that it has applied the fix, and update your plugins and themes too.

PHP 8.1 and older are no longer supported. The PHP team has published minimal source fixes for 7.4, 8.0 and 8.1, and some long-term support vendors offer backports, but the real answer is to upgrade. Cloudflare says sites behind it, including on its free plan, already have firewall rules for the known attack routes. That helps, but it is not a substitute for patching.

Because attackers were active before the fix, the NCSC and security firms also advise checking for signs that someone may already have got in.

Our view

For years the worry has been that AI would hand attackers new weapons. PHP2Shell shows the same tools working for defenders: a flaw that stumped people for two years was turned into a proof of concept in weeks, and fixed. The catch is speed. The moment details leaked, the window to patch shrank to hours, and the internet is full of forgotten PHP sites that will never be updated. Expect a long tail of break-ins from this one.

For transparency: Modern Robotics is a static site and does not run PHP.

Related: OpenAI's own AI agents tried to switch off their safety monitors.