PHP2Shell: What CVE-2026-109618 and CVE-2026-109619 Mean for Your PHP Stack

On 21 October 2026, PHP released 8.5.12, 8.4.27, 8.3.36 and 8.2.35. They fix two memory-safety flaws that, in PHP's own words, "can allow unauthenticated remote code execution". The project's advice is blunt: "All PHP users are strongly encouraged to update immediately."
The researchers call them PHP2Shell (php2shell.com); php.net and the official advisories use the CVE numbers, CVE-2026-109618 and CVE-2026-109619.
This post is written as of 22 October 2026. The exploitation picture is still moving, so check the linked sources before you act on anything time-sensitive.
Why This One Is Different
Most PHP security news is about a plugin or a framework. PHP2Shell sits underneath all of that. The flaws are in the PHP engine itself, in how it handles memory while setting up and tearing down requests. Wiz demonstrated unauthenticated remote code execution against WordPress, Drupal and Joomla, but the more important point is that no application bug is needed at all. Under mod_php, PHP says a demonstrated exploit fires "before any application code runs".
Your code quality does not decide whether you are exposed. The PHP version serving your web traffic does.
The Two Bugs in Plain English
CVE-2026-109618, "RCE via OOM corruption" (GHSA-w8hw-w9fx-j79w). When PHP runs out of memory, it bails out part-way through setting up a request. The cleanup code then treats the half-built data as if it were valid. The triggers include multipart uploads with no usable Content-Length, which get past post_max_size. PHP validated remote code execution over HTTP against mod_php with default limits.
CVE-2026-109619, "RCE via stale global state" (GHSA-6wmf-4rv5-p3rp). A PHP worker keeps pointers into the memory of a request that has already finished, and the next request on the same worker uses them: a use-after-free. An attack needs something that leaves the state behind (a fatal error, an out-of-memory condition or a timeout) and something on the same worker that later reads it. The impact is memory disclosure and code execution with the worker's privileges.
PHP rates both at CVSS v4.0 9.2 (Critical). You will also see 9.8, which is NVD's CVSS 3.1 score, and 10.0, which came from a leak before disclosure rather than from any official rating. Part of the gap is the scoring scale, and part is that PHP rates attack complexity as high where NVD rates it low. Both sit in the Critical band.
The discovery came from three teams working with the PHP security team: Calif, Wiz Research and OpenAI Codex Security, according to php2shell.com. Calif reported its first bug to PHP on 11 August; Wiz reported its findings on 24 August.
Who Is Affected
Versions. The official advisories list everything before 8.2.35, 8.3.36, 8.4.27 and 8.5.12. That understates it. PHP also published minimal source-only backports for 7.4, 8.0 and 8.1, and distributions have patched those branches too, which tells you they are affected. The researchers trace the earliest affected code back to PHP 5.4; Wiz says "nearly every PHP version is affected by at least one of these issues". The safe assumption: treat any PHP version older than the fixed releases as affected.
How PHP is served. PHP names "all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed". The risk is not equal across them:
| Setup | What the advisories say |
|---|---|
| Apache with mod_php | Highest risk. Remote code execution confirmed for both CVEs. |
| PHP-FPM | Remote code execution validated through CVE-2026-109619. No complete FPM exploit has been shown for CVE-2026-109618. |
| FrankenPHP, LiteSpeed, php-cgi | Named as at risk by PHP; exploitation less fully demonstrated. |
Every web-facing setup should patch, FPM included.
End-of-life branches. PHP 8.1 and older get no binary releases from the PHP project. Coverage from vendors varies: Ubuntu Pro covers 14.04 to 20.04 and cPanel has patched ea-php74 to ea-php85, while Amazon Linux lists AL2 Core php and AL2023 php8.1 as "No Fix Planned". And PHP 8.2 itself reaches end of life on 31 December 2026, so if you are patching 8.2 this week, plan the upgrade too.
What We Know About Exploitation (as of 22 October)
Sources disagree, so each claim below is attributed.
- Before disclosure. Amazon recorded an exploit attempt on 17 October, four days before the advisories went public. Amazon says it "remains unclear how the actor acquired exploit information". The CVE numbers also leaked on 20 October, and PHP published the advisories at 13:34 UTC on 21 October.
- After disclosure. Amazon calls PHP2Shell "broadly exploited in the wild" but says it is "unclear if any of these attempts would have succeeded". Cloudflare saw attackers changing their payloads to get past its rules. watchTowr reports exploitation observed as of 21 October.
- No confirmed compromise. Huntress had seen no in-the-wild exploitation on partner systems as of 4:30pm ET on 21 October. Neither CVE is in CISA's KEV catalogue.
- Exploit code. Proof-of-concept code is circulating, according to Amazon. Its reliability has not been independently verified, according to Tenable.
In short: attackers are actively trying, and nobody has publicly confirmed a successful breach. If you investigate your logs, start from 17 October, not from the disclosure date.
What to Do Today
1. Patch. Update to 8.5.12, 8.4.27, 8.3.36 or 8.2.35. PHP calls this "the only complete mitigation", and Wiz says the fix "eliminates all variants". Then restart Apache, PHP-FPM and every long-running PHP worker. Queue workers, Horizon, Octane and Reverb keep the old runtime until they restart, as Laravel Forge points out. Forge's automatic security updates do not patch PHP for you.
2. Confirm the version that serves the web, not the one in your shell. php -v reports the CLI binary. Check the web runtime: php_sapi_name() returns apache2handler for mod_php and fpm-fcgi for FPM, and php-fpmX.Y -v covers each FPM version.
3. Read distro version numbers against the distro's advisory. Ubuntu backports the fix without changing the upstream number. A patched Ubuntu 24.04 server reports PHP 8.3.6 (package 8.3.6-0ubuntu0.24.04.13, per USN-8948-1), so comparing it against 8.3.36 gives a false alarm. Debian, Red Hat and Amazon Linux publish their own fixed package versions.
4. Rebuild containers. The official Docker image's floating tags (latest, 8, 8.5, 8.4, 8.3, 8.2) now point at fixed builds. Re-pull and redeploy. Pinned older tags, third-party images and appliances with bundled PHP stay vulnerable until rebuilt.
5. Treat WAF rules as a stopgap. Cloudflare enabled rules by default (paid plans should confirm the Managed Ruleset is set to block) and calls them defence in depth, not a fix. AWS notes that "one of the two vulnerabilities is largely outside the reach of any web application firewall". A WAF also only protects traffic that passes through it.
6. If you cannot patch tonight, apply PHP's interim settings in php.ini or the FPM pool config (not with ini_set()), then restart every worker. Disabling session.upload_progress.enabled blocks the confirmed session paths for CVE-2026-109619; it is not a mitigation for CVE-2026-109618. Setting memory_limit=-1 narrows CVE-2026-109618 but is incomplete and opens you to memory exhaustion. The advisories are clear that no configuration change fully covers both bugs. Huntress also suggests keeping unpatched PHP behind a VPN or WAF and alerting when a PHP worker spawns a shell or a download tool.
7. Look for signs of compromise, and patch anyway. Watch for POST requests containing PHP_SESSION_UPLOAD_PROGRESS, unusual multipart requests followed by memory-limit errors or bursts of HTTP 500s, unexplained PHP worker churn, and oversized or malformed PHPSESSID cookies. As php2shell.com puts it: "Apply the PHP security update regardless of whether suspicious activity has been observed."
The Bigger Lesson
The teams that are calm this week share two habits.
They know what they run. Not "we use PHP", but which versions, under which SAPI, in which images, on which hosts. Ubuntu's version numbering and the gap between CLI and web runtimes show why a hand-kept spreadsheet is not enough: the inventory has to come from the running systems.
They patch the runtime on a schedule, not only in a crisis. Runtimes and base images are dependencies, like your Composer packages. If upgrading PHP is a quarterly project, a same-day patch will hurt. If it is a routine pipeline run with tests in front of it, it is an afternoon.
One of the three teams credited with this discovery was OpenAI Codex Security. If AI-assisted security research keeps surfacing bugs like this in mature, widely deployed code, a slow patching cadence will only get more expensive.
How We Can Help
We run web application security assessments that cover the full stack, including runtime versions and server configuration, not just the application layer. If you want a second pair of eyes on your PHP estate, or help building a patching pipeline that makes the next one routine, book a call.