AI & Automation

How AI Helped Uncover PHP2Shell β€” and What Defenders Should Learn

Manpreet SinghManpreet SinghNovember 19, 2026
How AI Helped Uncover PHP2Shell β€” and What Defenders Should Learn

The PHP2Shell disclosures were framed as an AI inflection point, but the record is more nuanced: decade-old memory bugs, a funded external audit, human researchers and tooling that shortened the path from suspicion to working exploit. This analysis separates the claims from the lessons for defenders.

In October 2026, two critical flaws in PHP put a familiar question back on the table: how much of vulnerability discovery is human insight, and how much is tooling? PHP2Shell β€” CVE-2026-109618 and CVE-2026-109619 β€” was described by one of the research teams as an "AI inflection point". Other accounts told a more gradual story, involving an externally funded audit, a PHP core developer, and a bug that had been sitting in the engine for more than a decade. The shorthand that an AI discovered PHP vulnerability captures part of the story, but it hides the collaboration behind the disclosure.

Both stories can be true at once. What matters for business and security leaders is not choosing a side in a technology debate. It is extracting the practical lessons: where bugs come from, how fast exploit code now follows disclosure, and what a defensible response looks like.

Key takeaways

  • PHP2Shell flaws sat in PHP's core memory handling and affected versions back to PHP 5.4 β€” the vulnerable code was more than a decade old.

  • Discovery credits span Calif, OpenAI, Wiz and PHP remediation developers, with an important earlier contribution from a PHP core developer during a 2024 externally funded audit.

  • Wiz argues AI changed the speed of turning suspicion into a working exploit, not the existence of the bug.

  • Details leaked before planned disclosure, and attack traffic appeared before patches shipped β€” showing how the disclosure process itself can become a risk.

  • For defenders, the lesson is operational: inventory, patch speed, worker restarts and detection matter more than how the bug was found.

What actually happened, in order

A precise timeline helps separate marketing from mechanism.

Date

Event

2024

PHP's first external security audit in years, funded by the Sovereign Tech Agency, organised through OSTIF and carried out by Quarkslab

11 Aug 2026

Initial report of an unconditional RCE issue to PHP by a researcher at Calif

20 Oct 2026

Public details surfaced ahead of coordinated disclosure; PHP announced an emergency release

21 Oct 2026

PHP released 8.5.12, 8.4.27, 8.3.36 and 8.2.35

21 Oct 2026

Cloudflare reported early attack traffic and deployed WAF protections

23 Oct 2026

A separate flaw, CVE-2026-115560, was disclosed with interim guidance

26 Oct 2026

CISA added both PHP2Shell CVEs to its Known Exploited Vulnerabilities catalog

The CVE credits list a reporter from Calif, a reporter from Wiz, OpenAI as finder, and several PHP developers as remediation engineers. That distribution is itself informative: discovery, validation and fixing were separate efforts.

The audit connection

The PHP Foundation's account is worth reading carefully because it complicates the simple "AI found it" narrative. In 2024, the Foundation secured funding from the Sovereign Tech Agency to organise an external security audit through OSTIF, performed by Quarkslab. While fixing one of the issues Quarkslab reported, a PHP core developer contracted by the Foundation found the first signs of the out-of-memory problem behind CVE-2026-109618.

That is a slow, unglamorous path to discovery: fund an audit, review findings, fix one bug, notice another. Wiz's own write-up acknowledges the vulnerable code had been there for more than a decade. The bug did not appear because of AI. What changed, according to Wiz, was the ability to understand the weaknesses and turn them into a working exploit β€” "what previously would have taken a world-class team months" becoming work a single researcher could complete in a week.

That is a claim from a vendor with a stake in the story, and it should be treated as such. But it is consistent with a broader pattern: AI-assisted analysis lowers the cost of reading large codebases, following complex control flow and iterating on proof-of-concept code. Those are exactly the tasks that made PHP2Shell hard to exploit.

Why the leak mattered more than the tooling

The most operationally significant event in the timeline may not be the discovery at all. It was the leak.

Details and proof-of-concept material circulated before the planned coordinated release on 21 October. Cloudflare said it observed attack traffic and deployed protections about nine hours ahead of public disclosure. Qualys reported that Cloudflare had already seen attempts to mutate payloads to evade protections. By the time patches were available, defenders were already behind.

There is a lesson here that has nothing to do with AI. Coordinated disclosure depends on a window in which vendors and large defenders can prepare. When that window collapses, the advantage shifts to attackers regardless of who found the bug or how. Boards and executives asking "did AI find this?" are asking the wrong question. The better one is "how quickly can we inventory and patch a runtime flaw across our estate?"

The AI claims, weighed

It is useful to separate three distinct propositions:

1. "AI found the bug." The public record does not support a clean version of this. Credit is shared among researchers and organisations, and the first technical signals came from a human developer during a 2024 audit. Treat "AI discovered PHP2Shell" as shorthand at best.

2. "AI accelerated exploit development." Plausible and supported by Wiz's account, though difficult to verify independently. The vulnerability involved non-trivial control-flow reasoning around longjmp() and memory corruption β€” a domain where fast iteration over hypotheses is valuable.

3. "AI will find more of these." Reasonable as a directional expectation, but not something a single incident establishes. More importantly, the same capability helps defenders: automated code review, faster patch analysis, detection engineering and log triage.

The balanced position is that AI changes the economics of both finding and exploiting bugs. It does not remove the need for human validation, careful disclosure or engineering judgement.

What defenders should actually take away

Inventory is the real prerequisite. CISA's alert warns that PHP is often a component of other software and its prevalence may not be directly observable. You cannot patch what you cannot find. The 22.6 million potentially exposed instances in Unit 42's telemetry are not a judgement about anyone's intelligence; they are a measure of how hard inventory is.

Patch the artefact that actually runs. In containers, that means rebuilding images. For FrankenPHP, it means replacing a statically linked binary that includes PHP. Updating an application framework does not change the engine beneath it.

Restart workers. A patched package with old workers still running is not a patched system. This applies to PHP-FPM, Apache mod_php, queue workers and long-running application servers.

Detect, do not assume. CISA added both CVEs to KEV on 26 October and published a SIGMA hunt rule. If an internet-facing PHP host was unpatched during the disclosure window, patching closes the door but does not tell you whether anyone entered. Hunt for PHP workers spawning shells, new files in web roots and unexpected cron entries.

Measure response time. The relevant metric is not how quickly a vendor publishes an advisory but how quickly your organisation can answer: which hosts run this runtime, which are internet-facing, when were they patched, and were they checked for compromise? If that takes days, process is the vulnerability.

The funding question hiding behind the story

The PHP Foundation used the announcement to make a different point: security work in widely deployed open-source infrastructure depends on sustained funding. Its 2024 external audit was made possible by a Sovereign Tech Agency grant. The first signals of one of the two critical flaws came from work connected to that audit.

For organisations running PHP at scale, that is a supply-chain consideration, not charity. A runtime that powers a large share of the web needs maintenance capacity. Companies that depend on it should expect to contribute β€” through funding, upstream review, or both β€” rather than assuming someone else will always do it.

This is also a corrective to the idea that AI makes maintainers obsolete. The tooling that helped analyse the flaw was built on a codebase maintained by people, and the fix was written by PHP developers. Automation amplifies maintained code; it does not replace maintaining it.

Applying the lesson inside your own team

If faster analysis is the change, defenders should use it deliberately rather than waiting for a vendor to do so. Four practical uses stand out.

Patch-diff review. When an advisory lands, compare the fixed and vulnerable source to identify which code paths changed. That tells you which configurations are relevant before you read a dozen blog posts. For PHP2Shell, the changes centred on memory and error handling, which is why settings like session.upload_progress and fatal_error_backtraces appeared in the guidance.

Inventory automation. Scan configurations, container images and installed packages for runtime versions and SAPIs. Map results to internet exposure. This is the least glamorous and highest-value use of automation in the whole incident.

Detection engineering. Turn public indicators and behavioural descriptions into rules for your own log sources, then test them against benign traffic to measure false positives. CISA's SIGMA rule is a starting point, not a finished product β€” its placeholder log source and medium-high false-positive note make that explicit.

Log triage. Use automated summarisation to reduce a large fatal-error log to the lines that matter, but keep a human in the loop for any decision that leads to isolating a production host.

The common thread is that automation shortens the path from advisory to a specific, verifiable action. It does not decide what is acceptable risk for your business.

Avoiding the two failure modes

There are two ways to get this story wrong.

The first is hype: treating PHP2Shell as proof that AI has solved security research, or that defenders should simply wait for machines to find everything. That ignores the decade-long history, the funded audit, the human credits and the fact that exploitation began before patches were ready.

The second is dismissal: concluding that because "AI found it" is an overstatement, nothing has changed. It has. The cost of analysing large, complex codebases and iterating on exploit ideas is falling. Defenders should use that same capability for inventory, patch validation, detection engineering and log analysis β€” and they should assume the attackers are using it too.

Where to go from here

The defensible summary is modest. PHP2Shell was a serious, old bug in foundational software, found through a mix of funded audit work and modern analysis tooling, disclosed messily, and exploited quickly. The technique used to find it is less important to your risk than the speed of your response.

If you run PHP, the useful next actions are the same ones that would apply regardless of who found the flaw: verify your runtime inventory, confirm patched versions and restarted workers, check the exposure window for compromise, and shorten the time it takes to do all three next time.

Share

Reduce the time between advisory and verified fix

SysopHost combines managed runtime maintenance, monitoring and engineer-led response so new advisories become a tracked checklist rather than an open-ended incident.

Talk to an Engineer

Comments

No comments yet. Be the first to comment!

Leave a Comment

Your email will not be published. Comments are reviewed before appearing. Protected by reCAPTCHA β€” Privacy & Terms