Pular para o conteúdo
← Back to Skalablog

Published article

What is PHP2Shell and which PHP versions does it affect?

Software EngineeringOpenAIGeminiAnthropic

PHP2Shell is the public name for two critical PHP vulnerabilities rated 9.2 that allowed unauthenticated remote code execution against the PHP engine itself, disclosed in October 2026. No confirmed successful exploitation has been reported yet, but the disclosure leak and fast AI-assisted exploit building pushed agencies to advise taking unpatched servers offline.

What is PHP2Shell and why does it affect every PHP version?

PHP2Shell is the name given to two critical vulnerabilities in the PHP engine itself, published in October 2026 with a severity score of 9.2 out of 10, that can give an unauthenticated attacker remote code execution on an affected server. The flaw lives in PHP's own request handling, so patching a CMS or plugin does not remove it; the PHP runtime must be updated.

The mechanism described by the PHP Foundation is a race around memory exhaustion. If a request drives PHP out of memory at exactly the wrong moment, half-constructed internal data can survive, and a later request may treat that leftover state as trustworthy. With a crafted request, that turns into code execution without any login.

Wiz Research, which published its disclosure, demonstrated the exploit against clean installs of WordPress, Drupal and Joomla. Wiz reported that even a minimal PHP application is exposed because the vulnerable code belongs to the language, and that every PHP release from the preceding decade is reachable through one of the two flaws.

The practical consequence is scope: PHP runs a large share of public websites, so the population of potentially affected servers is enormous. Better Stack's 22 October 2026 video put that figure at roughly 70 percent of the web, a widely repeated but vendor-quoted estimate rather than an independently audited measurement.

Where to find the patches and which PHP versions got them

Patch availability split by version: only PHP 8.2 and newer received proper upstream releases, while older branches got source patches that operators must build themselves. That distribution gap, more than the bug itself, explains why the incident dragged on for smaller and older deployments.

The PHP security advisory and the PHP Foundation's release notes list the affected branches. Andrej Surij? maintain the Debian and Ubuntu packaging described in the coverage reported fixes reaching back to PHP 7.4, which matters because many production servers run distribution packages rather than upstream builds.

A scan cited in the coverage found 59 percent of observed servers still reporting PHP 8.1 or older. Those are the machines least likely to be rebuilt within a week, and they form the long tail the agencies warned about.

How the PHP2Shell disclosure leaked a day early

The PHP2Shell release was planned for Thursday and shipped a day early after the CVE identifiers appeared on Hacker News with a wrong severity rating. The coordinated-disclosure calendar collapsed within hours, and each subsequent slip widened the window for attackers.

The sequence matters because it shows how brittle embargo coordination becomes once one party publishes.

The leak, hour by hour

Tuesday afternoon: CVEs posted early

paragraphs on the two identifiers appeared on Hacker News with an incorrect score of 10 out of 10. The person who posted them later apologised and said their source had told them no embargo was in place.

Tuesday evening: PHP pulls the release forward

paragraphs

PHP gave advance notice and moved the release forward by a day. Around the same time, Calif, one of the firms credited with the find, published exploit footage against real targets; the video was deleted, but copies spread on social media.

Wednesday morning: patched images appear ahead of release

paragraphs

More than six hours before the coordinated release, Chain Guard published patched PHP images. The PHP Foundation described that as a unilateral break of the embargo, because anyone could study the fix while other operators were still waiting.

02:00 UTC Wednesday: the patch lands

paragraphs

By the time the fix shipped, the rough location of the vulnerability was already public knowledge. Disclosure norms assume that finding the bug is the hard part; PHP2Shell showed that assumption no longer holds when a fixed artifact can be diffed early.

Which sites went offline and what agencies advised

The NSA, CISA, the FBI and the UK's NCSC all advised organisations that could not patch immediately to take affected systems offline, an unusually blunt instruction for a web-facing vulnerability. Several operators followed it rather than risk exposure.

The outages were mostly choices, not breaches.

Named outages and advisories

  • Netherlands: DigiD, the national login service, went down along with parliament's website and the national cyber security site.
  • United Kingdom: university sites in Edinburgh, Bristol and Oxford went offline.
  • Wikipedia: parts of Wikimedia infrastructure were taken down.
  • Forums: 4chan and Something Awful switched off until patches landed, and BreachForums did the same.
  • Agencies: the CISA alert repeated the offline advice for systems that could not be updated straight away.

Better Stack reported that one operator disconnected every server in their business before the patch dropped, and a Reddit administrator said it was the first time in 20 years they had deliberately taken a site down.

Edge protection softened the impact. Cloudflare had been briefed weeks ahead and enabled firewall rules for every customer at 03:00 UTC on Wednesday, and its telemetry showed attackers adjusting payloads to evade those rules.

Has anyone actually been exploited yet?

No confirmed successful exploitation of PHP2Shell had been reported at the time of the video. Watchtower said it observed real attempts using exploit tooling assisted by AI, and CISA said it had not yet seen successful compromise, so the visible damage came from defensive shutdowns.

That is a statement about the reporting window, not a permanent guarantee. The exposure is concentrated in servers that will not be rebuilt quickly, and the agencies' guidance reflects that risk rather than evidence of mass compromise.

Who found PHP2Shell: OpenAI, Wiz, Calif and the credit dispute

Credit for PHP2Shell was contested within hours of publication. OpenAI said Calif found the flaw with GPT-5.6 Sol under its Patch the Planet programme and described it as one of the most impactful vulnerabilities in recent memory; Wiz said it found the bugs independently and credited Gemini 4 Argon with an invaluable contribution; Calif published a rebuttal pointing to an August 5 tweet as evidence its researcher was first.

Google's ownership of Wiz is relevant context for that second claim, though ownership does not settle who discovered what. Calif also stated that its researcher used no special harnesses and no models unavailable to the public, chose PHP because they knew its history, and had a theory about where the bugs were hiding.

That theory traces to a PHP Foundation security audit in 2024 that had already flagged early signs of the same problem without proving exploitability, which is why the fix stalled for two years. Earlier scanning with Anthropic Claude also missed it.

What changed in 2026: AI-assisted exploit development

The bug class behind PHP2Shell is old research, and the 2024 audit already suspected it. What changed in 2026 was the speed at which someone who knew where to look could turn a theory into a working exploit, and that speed is what made the disclosure window dangerous.

Wiz's own comparison is that one researcher achieved in a week what a world-class team would once have needed months for. Treat that as a vendor-reported estimate rather than a measured benchmark, because no controlled study of AI-assisted exploit development backs the number.

The same-week Node.js, GitLab and Railway news

PHP2Shell did not arrive alone. On the same day, Node.js patched a remote code execution flaw of its own and GitLab shipped a fix for a vulnerability rated 10 out of 10, which shows the disclosure volume rather than any shared code path.

Separately, Railway announced a breach of the systems storing customer environment variables, with decrypted values exposed for some customers. Railway said nothing links it to PHP2Shell and described it as likely part of a series of attacks aimed at AI provider keys.

Taylor Otwell, the creator of Laravel, summed up the wider pattern: it will probably not be the last time, and PHP probably will not be the only language to go through it.

What should a PHP operator do after PHP2Shell?

Update PHP itself, then inventory the servers you had forgotten. Plugin and CMS updates do not address PHP2Shell, because the vulnerable code is in the interpreter, and the older branches require building the vendor patch rather than pulling a package.

  1. Identify every PHP runtime you operate, including staging, internal tools and abandoned projects.
  2. Move to a patched release on PHP 8.2 or newer where possible, or build the upstream patch for older branches.
  3. If patching cannot happen immediately, take the service offline or put it behind a web application firewall with rules for this vulnerability.
  4. Re-check after the fact: the long tail of PHP 8.1 and older servers is where exposure persists.

Compliance officers should read the agency guidance as risk advice, not a certification. Running a patched runtime supports a defensible posture; it does not by itself establish regulatory compliance for a regulated workload.

FAQ

  • What is PHP2Shell? PHP2Shell is the name for two critical vulnerabilities in the PHP engine, published in October 2026 with a severity score of 9.2, that can allow unauthenticated remote code execution on unpatched servers.
  • Does updating WordPress fix PHP2Shell? No. The flaws are in PHP itself, so updating a CMS, theme or plugin leaves the vulnerable interpreter in place. The PHP runtime has to be updated or patched.
  • Which PHP versions were affected? Coverage reported that every PHP version from the preceding decade could be exploited through one of the two flaws, and that only PHP 8.2 and newer received proper upstream releases.
  • Was PHP2Shell exploited in the wild? No successful exploitation had been confirmed at the time of the 22 October 2026 coverage. Watchtower reported real attempts, and CISA said it had not seen successful compromise.
  • Why did the disclosure happen a day early? CVE identifiers were posted publicly with an incorrect severity rating before the embargo lifted, leading PHP to pull its release forward and other parties to publish related material early.
  • Who discovered PHP2Shell? OpenAI said Calif found it with GPT-5.6 Sol, Wiz said it found the bugs independently with help from Gemini 4 Argon, and Calif disputed the ordering. The credit remains contested.
  • What should I do if I cannot patch right away? The NSA, CISA, the FBI and the UK's NCSC advised taking affected systems offline when immediate patching is not possible. A web application firewall reduces but does not eliminate exposure.
  • Is PHP2Shell related to the Railway breach? No link has been established. Railway described its incident as likely part of a series of attacks targeting AI provider keys.

Source video