跪拜 Guibai
← All articles
Security · AI · PHP

PHP2Shell: AI Found the Memory Bugs Days Before the Patch, and Attackers Were Already Exploiting Them

By 王若风 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The PHP2Shell saga compresses the interval between a vulnerability's discovery and mass exploitation: AI-assisted development turned memory bugs that once required deep specialization into usable exploits within days, while attackers were already striking before the patch shipped. Edge protections like WAFs buy time but don't replace the runtime update, and a leaked CVE with a wrong severity score directly costs unpatched servers.

Summary

PHP2Shell bundles two vulnerabilities, CVE-2026-109618 and CVE-2026-109619, that live in PHP's runtime memory and error handling. Wiz traced affected versions back to PHP 5.4 and showed every release in the past decade carries at least one of the flaws. The team also demonstrated a path that reads passwords, tokens, and API keys from process memory without remote code execution. OpenAI's Calif used GPT-5.6 Sol under the Patch the Planet program to find one critical flaw, while Wiz independently discovered both and used Wiz Atlas, Gemini 4 Argon, and GPT-5.6 Sol to adapt the exploit across PHP versions, configurations, and memory layouts.

Attackers moved before the patch existed. AWS MadPot recorded an exploitation attempt on October 17, four days before the advisory. Cloudflare reported thousands of attempts within hours of the announcement, spiking to hundreds of thousands within two hours. The PHP Foundation moved the release from October 22 to 21 after CVE numbers leaked early with an incorrect 10.0 severity score, and distributors were left scrambling. Patched releases are 8.2.35, 8.3.36, 8.4.27, and 8.5.12. Administrators must verify the actual PHP-FPM or mod_php binaries, not just the CLI version, and confirm container images and workers restarted. WAFs from Cloudflare gave a default protection layer, but the NSA advisory is blunt: inventory PHP services, patch, or take them offline.

Takeaways
— PHP2Shell is the collective name for CVE-2026-109618 and CVE-2026-109619, memory-corruption issues in the PHP runtime triggered after memory exhaustion or fatal errors.
— Affected versions trace back to PHP 5.4, and every PHP version released in the last decade carries at least one of the two flaws.
— Wiz demonstrated reading passwords, tokens, and API keys from process memory without achieving remote code execution.
— OpenAI's Calif used GPT-5.6 Sol under Patch the Planet to find a critical vulnerability; Wiz independently discovered both bugs.
— Wiz used Wiz Atlas, Gemini 4 Argon, and GPT-5.6 Sol to iterate on exploit development and adapt it across PHP versions, configurations, and memory layouts.
— AWS MadPot recorded a PHP2Shell exploitation attempt on October 17, four days before public disclosure, sourced from a commercial anonymizing network.
— Cloudflare reported thousands of exploit attempts within the first ten hours of the advisory, tens of thousands within 45 minutes, hundreds of thousands within two hours, and millions later.
— The PHP Foundation moved the release from October 22 to 21 after CVE numbers leaked on October 20 with an incorrect 10.0 severity score; the actual score is 9.2.
— Patched PHP versions are 8.2.35, 8.3.36, 8.4.27, and 8.5.12.
— Cloudflare enabled WAF protection by default on October 21 at 03:02 UTC for free and paid customers.
— The NSA advisory instructs inventorying PHP-dependent services and applying patches, or taking services offline until risk is mitigated.
— OpenAI released a Codex skill (php2shell-checker) for version checking, but a version check does not prove a system is uncompromised and does not replace verifying backport patches or running processes.
— To confirm a fix, check the actual PHP-FPM or mod_php binary, not just php -v; confirm container image replicas were replaced and workers restarted.
— A retrospective should start from the earliest known exploitation time, checking logs and host indicators before assuming the patch solved everything.
Conclusions

The hardest part of PHP2Shell isn't that AI found a bug; it's that AI-era tooling lets researchers and attackers alike turn memory-corruption findings into working exploits across varied PHP environments, shrinking the time from a discovered flaw to a usable attack.

The early CVE leak with a wrong severity score shows how fragile coordinated disclosure becomes as participant count grows; one mistaken number forced a release a day early and left distributors unprepared.

AWS's pre-disclosure observation and OpenAI's claim that frontier AI found the flaw earlier than attackers are not in tension: research advance does not guarantee secrecy, and the four-day gap is best treated as a forensic starting point, not a settled explanation.

Edge protections like WAFs buy time but create a false sense of completeness when backends or test environments bypass them; only the patched runtime closes the hole.

Measuring AI's security contribution by the number of discovered vulnerabilities overstates its value; the actual test is whether findings translate into patches that reach running systems before exploitation.

Concepts & terms
mod_php
The Apache module that embeds the PHP interpreter directly into the web server process, allowing an attack to trigger code execution before application-level checks such as authentication run.
WAF
A Web Application Firewall that filters and monitors HTTP traffic to block malicious requests; here it provided temporary edge protection before the underlying PHP runtime could be patched.
Backport
A fix applied to older, unsupported versions of a software package rather than a new release; needed when a project cannot migrate to a fully patched version, and it must be verified separately from upstream version numbers.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗