Skip to content

Back to the catalog

PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet
wiz.iowriteup

PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet

PHP2Shell is Wiz Research's disclosure of memory-safety bugs in core PHP, grouped under two CVEs (up to CVSS 9.2) and fixed in patched releases on 21 October 2026. The post details four bugs, all triggered by out-of-memory fatal errors that leave stale state: an upload-progress unserializer use-after-free, a session-ID memory disclosure, a fatal-error backtrace use-after-free and an OPcache type confusion. It describes unauthenticated RCE on WordPress, Drupal and Joomla, plus detection signals and a disclosure timeline.

TL;DR Wiz Research describes four PHP engine memory-corruption bugs chained into unauthenticated RCE, built with frontier AI models and patched 21 October 2026.
Document

What it is

PHP2Shell is Wiz Research's October 21, 2026 disclosure of memory-safety bugs in the PHP core engine, grouped under two CVEs with severity up to CVSS 9.2. The page does not give the CVE IDs or the patched version numbers. It says only that PHP shipped patched releases on October 21, 2026. Wiz says every PHP release back to 5.4 is affected by at least one of the bugs, though it does not map bugs to versions.

How it works

All four bugs share one pattern. A fatal out-of-memory error aborts a request and destroys the request heap, but a global pointer is left set. A later request handled by the same PHP worker then trusts that stale pointer after an attacker has reclaimed the memory. The flaws are in PHP itself, so Wiz says even a "Hello World" app on an affected version can be vulnerable.

  • Upload-progress unserializer use-after-free: the Session module decodes data during multipart upload-progress handling, before normal initialization. An allocation failure leaves BG(unserialize) published. Wiz paired this with the memory disclosure to get unauthenticated RCE on WordPress, Drupal and Joomla.
  • Process-memory disclosure: an out-of-memory error during RFC1867 multipart parsing can leave PS(id) pointing at freed memory. A later multipart request URL-encodes the reclaimed heap contents into a PHPSESSID response cookie. This works even if the app never calls session_start(). Wiz read an attacker-sized region of live worker memory, which can hold passwords, tokens, API keys and certificates from other requests.
  • Fatal-error backtrace use-after-free: EG(last_fatal_error_backtrace) is not cleared after an out-of-memory fatal. A diagnostic early in the next request follows the dangling pointer. Wiz used this for unauthenticated RCE on Drupal.
  • OPcache type confusion: zend_accel_script_persist() advances the process-local CG(map_ptr_last) before publishing the shared frontier. An allocation failure in between leaves slots that another worker can reuse as a different type. Wiz used this for unauthenticated RCE on WordPress.

Wiz says it used AI models (Gemini 4 Argon, GPT-5.6 Sol and Wiz Atlas) to adapt exploits to different memory layouts in hours. It says a single researcher did in a week what would have taken a skilled team months.

Preconditions / Affected

  • The target runs an unpatched PHP engine, with no dependence on the CMS. WordPress, Drupal and Joomla (latest container images at test time) were demonstration targets only.
  • Exploitation needs a worker that survives an out-of-memory fatal and then serves a later request. The memory disclosure and upload-progress bugs need multipart requests.
  • Wiz says other tracked and untracked variants exist with different exploitation requirements. It says the PHP patch fixes the root cause and removes all variants in the patched release, and that other variants fold under the same two CVEs.

What to do

  • Apply the PHP security update. Wiz calls it the only complete remediation.
  • If patching must wait, look for provider mitigations. Wiz names Automattic, Akamai, AWS, Cloudflare, Fastly, Google, Imperva, Microsoft and Vercel as having prepared guidance or mitigations, but the page gives no specifics.
  • Hunt for these signals: unusual multipart requests followed by memory-limit errors or repeated HTTP 500 responses, unexpectedly large or malformed PHPSESSID response cookies, and unexplained PHP worker churn. Application logs may show little, since the bugs act below the application layer.
  • Wiz Sensor version 1.0.12768 has a built-in response policy that terminates processes behaving like PHP2Shell exploitation. The page gives no other detection queries.

Caveats

  • The "70% of the Internet" figure is PHP's share of websites, not a count of vulnerable hosts.
  • The detection signals are described as investigation guides, not reliable indicators.
  • The page says the exploit script is named php2shell but does not say it is public. Wiz's own tooling and its partner Google's quote make up much of the AI framing.

Organisations named here

  • GPT-5.6 Sol
  • Heartbleed
  • type confusion
  • Wiz Research

Technologies named here

  • PHP core engine
  • php2shell
  • PHP Session module
  • PHP OPcache
  • WordPress
  • GPT-5.6 Sol
  • Wiz Threat Intel Center advisory for PHP2Shell
  • Drupal
  • Wiz Defend and Wiz Sensor
  • Joomla
  • Wiz Runtime Sensor add-on for GKE
  • PHP
  • Gemini 4 Argon
  • Wiz Atlas
  • OPcache

Techniques named here

  • Fatal-error backtrace use-after-free
  • OPcache cross-worker type confusion
  • AI-assisted exploit development
  • Use-after-free

Threat actors named here

  • PHP2Shell
  • Calif
  • Log4Shell