PHP2Shell: two unauthenticated PHP RCEs, and an embargo that leaked three ways
Two unauthenticated remote code execution bugs in PHP's fatal-error handling, reported by Calif, OpenAI and Wiz Research. Wiz says it used AI models throughout. Fixes shipped on October 21, a day early, after the CVE IDs, a PoC video and patched images all got out first.
Amazon's honeypot logged an exploit attempt on October 17. PHP shipped the fix four days later, at 14:00 UTC.
On October 21, 2026, the PHP project released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 to fix two critical unauthenticated remote code execution bugs. Wiz Research and Amazon call the pair PHP2Shell.
Both bugs score 9.2 on CVSS v4.0: CVE-2026-109618 (GHSA-w8hw-w9fx-j79w, "RCE via OOM corruption") and CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp, "RCE via stale global state"). A 10.0 score circulated before release, and the PHP Foundation says it was wrong. PHP 8.1 and older get no upstream fix, only minimal source backports for 7.4, 8.0 and 8.1. PHP 8.2 itself reaches end of life on December 31, 2026.
A fatal error mid-request can hand freed memory to the next request
Per the Foundation, both bugs sit in fatal-error handling. In the first, hitting memory_limit at the wrong moment leaves half-built internal data that PHP later treats as valid. In the second, a fatal error leaves request state pointing at freed memory, and the next request on the same worker uses it: a use-after-free.
Wiz lists four underlying bugs: a use-after-free in the upload-progress unserializer, memory disclosure through the PHPSESSID cookie, a use-after-free in fatal-error backtraces, and an OPcache type confusion. Wiz says every PHP release back to 5.4 has at least one of them, and it showed RCE in a lab against WordPress, Drupal and Joomla images.
Apache mod_php is exposed before any app code runs
For CVE-2026-109618, the Foundation writes that on Apache with mod_php "an unauthenticated request can trigger this before any application code runs," and full RCE was shown with default settings. On PHP-FPM, RCE was confirmed only through application code paths. The second bug was also shown on mod_php, against a real application.
Three teams, several models, human-written patches
Per the Foundation, Ryan A of Calif reported on August 11 under Calif's Patch the Planet program, and OpenAI reported the same root cause that day. Wiz Research (Sagi Tzadik, Shir Tamari, Nir Ohfeld, Tomer Schwartz) followed on August 24. On its own side, the Foundation says an earlier 2026 scan of PHP with Alpha-Omega used Anthropic's Claude Mythos, that it later added OpenAI's Daybreak Red to validate reports and exploits, and its acknowledgments name Codex Security. It does not say whether Calif's finding was AI-assisted. AI helps validate and group reports, it says, but "a person makes every call and works on every patch."
We used Wiz Atlas, Gemini 4 Argon and GPT-5.6 Sol throughout this research.
Three leaks before the release, and an attempt before any of them
PHP2Shell disclosure timeline, 2026 (UTC)
Oct 17 AWS MadPot sees an exploit attempt from 103.216.220.92
Oct 20 ~15:00 CVE IDs leak, with a wrong release time and a 10.0 score
Oct 20 19:30 PHP publishes its pre-announcement early
Oct 20 ~20:00 Calif posts a video of its PoC by mistake
Oct 21 ~02:00 AWS sees the first public PoCs and attempts
Oct 21 07:41 Chainguard publishes patched images 6+ hours early
Oct 21 14:00 PHP releases the fix, moved up from Oct 22
Sources: PHP Foundation, AWSThe Register reports that PHP blames Chainguard for the early images. AWS's CJ Moses writes that PHP2Shell "is now being broadly exploited in the wild" and advises investigating from October 17. CISA had not observed exploitation when it published, and advised taking unpatchable systems offline. Per Engadget, the Netherlands, Denmark, France, Finland and Canada took some government sites down as a precaution.
What is not confirmed
AWS does not know how the October 17 actor had details, and no source says whether any attempt succeeded. No one has published a count of exposed servers. php.net says there is no complete mitigation short of updating.
Why a build studio cares
Our reading: how PHP is attached to the web server matters as much as the version. On mod_php the first bug is reachable before WordPress loads a single plugin, so hardening the app does not help. On PHP-FPM the exposure runs through your own code. Our own site is a static Next.js export on Cloudflare Pages, with no PHP for this to reach. A WordPress owner on managed hosting may not know which mode they run, or who can patch it today. That is the hosting-control question in a software audit. The interim settings below buy time; php.net says they do not make an install safe.
# Which PHP, which SAPI? Check on the host first
php -v
php-fpm -v # binary name varies, e.g. php-fpm8.3
php -i | grep "Server API" # the CLI reports itself; also read your Apache or FPM config
# Fallback only: a temporary <?php echo PHP_VERSION, ' ', PHP_SAPI; page, deleted right after
# apache2handler = mod_php, fpm-fcgi = PHP-FPM
# Fixed: 8.5.12, 8.4.27, 8.3.36, 8.2.35
; Interim only, per php.net: these reduce exposure, they do not make an install safe
; CVE-2026-109618
memory_limit = -1 ; set so apps cannot override it (php_admin_value)
; use a container or cgroup limit, not RLIMIT_AS or RLIMIT_DATA
post_max_size = 8M ; 32M if uploads are needed, upload_max_filesize below it
; CVE-2026-109619: php.ini, FPM pool or server config, then restart every worker
session.upload_progress.enabled = 0
fatal_error_backtraces = 0 ; PHP 8.5 only
; ini_set() and FPM .user.ini do not countNext step: today, find the PHP version and SAPI on every server you run, and update to a fixed release using the notes in the php.net release archive. If you run PHP 8.1 or older and cannot move yet, a software audit shows what runs where and who can patch it. Write to us at hello@gattyworks.com.