Security researchers used artificial intelligence to discover two serious flaws in PHP, the programming language that powers roughly 70 percent of all websites worldwide. An attacker could exploit them to execute their own code on a server without having to log in anywhere. The flaws were collectively named PHP2Shell, and PHP developers rated them 9.2 out of 10 on the severity scale.
But people in the industry are not only concerned about the scale of the problem. Above all, they are discussing how the flaw was found. A language model did much of the work involved in tracking it down.
An old lead and an unexpected discovery
The discovery was made by the American security company Calif. On July 30, at the request of the PHP Foundation, its researchers began reviewing PHP's source code with the help of OpenAI's GPT-5.6 Sol model. They did so as part of the Patch the Planet program, which gives security experts access to the most powerful AI models and allows them to use those models to search for vulnerabilities in the software on which the internet is built.
Calif did not have high expectations. The company admitted that it did not expect to find critical flaws because PHP had already been thoroughly examined by other experts, also with the help of AI. PHP is among the most closely scrutinized pieces of software in existence, and security experts have been digging through it for decades.
Researcher Ryan Austin worked on the hunch that old vulnerabilities were hidden in older parts of the code, using the model as an assistant. The trail led deep into the past. The first PHP flaw related to memory limits was described by Stefan Esser back in 2004. In 2020, someone reported a similar issue to the project, and in 2024 the same issue was rediscovered in an audit by OSTIF and Quarkslab. However, experts considered it too difficult to exploit, so it was forgotten.
Austin therefore gave the model a specific task. He directed it to focus on PHP's behavior when it reaches its permitted memory limit, meaning a situation in which memory allocation fails, a fatal error occurs, and the program terminates.
AI discovered the flaw
The model read the source code and tracked how data flows through PHP. It discovered that one of the internal data tables was being prepared in the wrong order. It then traced a path in which PHP accesses the table in a corrupted state while processing submitted form data.
In simple terms, when PHP runs out of memory while processing a request, it may leave behind partially completed work. The first flaw causes PHP to mistakenly process incomplete or corrupted data. The second involves it using stale data from an earlier request even though the memory in which it was stored has already been freed. A skilled attacker can turn both weaknesses to their advantage and feed their own commands to the server.
What makes this particularly insidious is that it happens before the website even starts running. Even a page that merely prints OK may be vulnerable, because the faulty processing occurs before a single line of the application's own code is executed. It therefore does not matter how carefully the website itself was written.
Calif found the flaws within a few days. It made the initial discovery using the publicly available GPT-5.6 Sol model and without a specialized testing environment. To create functional exploits, the researchers used an unreleased OpenAI model. The model helped them find a new issue, turn it into a reproducible procedure, and use it to uncover another one. However, the company is tempering the notion that AI solved everything on its own. It says that knowledge of PHP's history played a greater role than the model itself and that no system can yet uncover every flaw from a few simple instructions.
Calif was not the only company looking for flaws. Independently, researchers at Google-owned Wiz also discovered the flaws on August 19. They were assisted by the Gemini 4 Argon and GPT-5.6 Sol models together with the company's own Wiz Atlas tool. According to them, AI was used primarily to adapt test exploits for different versions of PHP and different server configurations, and to analyze why some attempts failed. Wiz did not mince words. According to the company, a single researcher using the most powerful models accomplished in one week what would previously have taken a world-class team months. Company co-founder Ami Luttwak added that the flaw was probably so complex that no one would have discovered it without AI.
Sources do not fully agree on how long it had been lurking in PHP. OpenAI co-founder Greg Brockman says fourteen years. PHP versions from 5.4 through 8.5 are affected.
A race against time
After the discovery came a phase that ordinary users know nothing about. On August 11, Calif CEO Thai Duong alerted PHP developer Volker Dusch, beginning a quiet joint effort to fix the problem before attackers learned about it. A few days later, the company sent the developers a working proof-of-concept exploit, and on August 21 it reported the second flaw. The researchers kept everything strictly confidential because they feared that, in the meantime, the flaw might be found by a hacker who was also being assisted by AI. PHP maintainers, other researchers, security companies, and US authorities, including the CISA agency, all became involved in preparing the fixes.
However, the plan did not go entirely as intended. Disclosure was scheduled for October 22, but details of the flaws and a proof-of-concept exploit leaked ahead of time. The PHP Foundation therefore moved the release forward by one day, and the patched versions 8.5.12, 8.4.27, 8.3.36, and 8.2.35 were released on October 21.
Someone immediately seized on the flaws and attempted to exploit them four days before the official disclosure, while security company Sansec expected mass attacks within fifteen minutes of the patches being released. Because the vulnerability is in PHP itself, websites built on WordPress, Drupal, or Joomla may also be at risk.
Duong described the concerns in rather blunt terms. According to him, all it takes is for some guy on Twitter to take the patches, run them through AI, and publish a ready-made exploit. The same tool that helped discover the flaw can significantly shorten attackers' path to a working exploit.
The story also has a darker side. The PHP Foundation, which maintains the language, has only thirteen full-time or part-time employees and relies on donations, while billions are pouring into AI research. PHP developers themselves admitted that they had already observed the first signs of the problem in 2024.
OpenAI claims that, according to its information, AI found these vulnerabilities before attackers did. It plans to provide security teams with access to its models worth one billion dollars and has offered programmers a Codex extension that checks whether their website or PHP installation is vulnerable to PHP2Shell.
Sources: openai.com and nytimes.com



