What A Time To Be Alive
Choose language: English

Two-year-old PHP flaw fixed after AI helped unravel the bug

The PHP Foundation has fixed two serious flaws in PHP, one of which had been known since 2024. AI helped to unravel the old bug. The flaws are now being exploited, so updating is important.

Drawn scene at dusk: a drone shines a blue beam on a long crack in a tall brick wall below a hilltop town, while two builders on scaffolding fill the crack with mortar.
Illustration: an old bug, tracked down with the help of AI and repaired by humans.

The PHP Foundation fixed two serious security flaws in PHP on 21 October 2026. PHP is a programming language that a large part of the web runs on: about 70 per cent of all websites, according to OpenAI. The two flaws, together called PHP2Shell, let attackers run their own code on a web server without logging in, under certain conditions. They received a severity score of 9.2 out of 10. The fix is in PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12.

What was wrong

Both flaws lie in the way PHP handles memory and errors. This happens with almost every visit to a website. With the first flaw, PHP could get confused if a request hit the limit of the allowed memory at exactly the wrong moment: half-built data was then treated as valid. With the second flaw, an error could cause a following request to use memory that had already been released. According to the Foundation, the widely used combination of the Apache web server with mod_php was especially vulnerable. There, one request from outside was enough, before the website itself did anything.

A bug that stayed for two years

The first problem was not new. A PHP developer saw the first signs in 2024, when he fixed another bug found in PHP's first external security audit in years. Nobody found a concrete way to exploit it at the time, and other problems took priority. After that, the repair stalled for months. The security team had several solutions, but each had a drawback: one would have broken existing software, another made it easier to knock servers offline, and a third would have forced thousands of PHP extensions to be changed. The team only decided when everyone agreed, and nobody wanted to make the wrong choice. The Foundation itself calls the delay a structural failure, caused by this way of deciding and by too few people. The team will now decide by majority vote.

AI found the route to exploitation

On 30 July 2026, the security company Calif began an audit of PHP, as part of OpenAI's programme Patch the Planet. On 11 August, Calif researcher Ryan A. reported a way to exploit the old bug. OpenAI researchers reported the same cause the same day, independently. According to OpenAI, its model GPT-5.6 Sol helped to turn a bug that humans had not solved for two years into working attacks within two weeks. The security company Wiz reported another attack route on 24 August, and OpenAI reported more in September. From 11 August, several developers paid by the Foundation worked full time on the fix.

A messy disclosure

The disclosure did not go as planned. On 20 October, the numbers of the flaws were already circulating online, with an incorrect score of 10.0. The Foundation therefore moved the new versions forward by one day, to 21 October. That evening, Calif accidentally put online a video in which its own attack tool worked. Calif removed the video, but copies were already circulating. The next morning, the software supplier Chainguard released packages with the fix more than six hours before the agreed time. As a result, attackers could study the fix before most administrators could install it.

Exploitation, and what administrators can do

The flaws are now being exploited. On 26 October, the US cyber agency CISA added both to its list of flaws that are being actively exploited. The security company Dream Security reported that attackers combined PHP2Shell with Fragnesia, a flaw in the core of Linux. This gave them full control of 25 servers in the United States, Japan, Taiwan and South Korea, and they then attacked three servers in an environment connected to the US government.

According to counts by the research company Censys, about 30 million PHP installations on the internet were still running a vulnerable version at the end of October. Many of them use an old PHP version that no longer receives official updates. For such versions, Linux distributions and other suppliers offer their own fixes, but moving to a supported version is the safest choice. Cloudflare added rules to its filter that blocks attacks on websites. Anyone with a PHP website is best advised to check whether it already runs one of the new versions, or to ask the hosting provider whether that has been done.

What does this mean for the road to the singularity?

This is a clear example of how AI speeds up the search for flaws: a bug that humans could not understand for two years was unravelled within weeks with the help of AI. OpenAI points out that the same skill can also help attackers, and therefore sees a period in which defenders must use AI before attackers do so on a large scale. The Foundation draws an important lesson: AI finds bugs faster, but choosing the right fix for an old design decision remains work for experienced developers, and they are scarce. That is why the Foundation has had a separate security team for the whole PHP ecosystem since May, hired two extra developers this summer and uses AI tools such as OpenAI's Daybreak to check reports. It asks companies, hosting providers and governments that run on PHP to support this work. In this way, software that almost everyone uses becomes safer, step by step.

What is the technological singularity? Read the explanation →

Sources

  1. Tom's Hardware
  2. Tom's Hardware
  3. TNW | Data-security
  4. The PHP Foundation
  5. BleepingComputer
  6. TNW