Two critical flaws in PHP's C runtime (CVE-2026-109618 and CVE-2026-109619) allow unauthenticated remote code execution before any application code runs. No authentication bypass, no padding error, no app-layer flaw required. The exploit fires inside the PHP interpreter itself.
Patches exist for PHP 8.2–8.5. PHP 7.4, 8.0, and 8.1 received minimal source backports only, no official binaries. A security vendor's banner count puts 59% of version-advertising PHP hosts on branches that get no official patch. Exploitation attempts began before disclosure; no confirmed breach has been reported so far.
The Vulnerabilities
CVE-2026-109618: Out-of-Memory Corruption
PHP enforces a per-request memory ceiling via memory_limit. When a request exhausts that limit, PHP raises a fatal error and begins cleanup. The bug is in that cleanup routine: it can be interrupted mid-way, leaving internal PHP request structures partially initialized. The cleanup routine then processes that incomplete state as if it were valid, a confused-deputy scenario where the error handler trusts data it should never have touched.
The consequence is unauthenticated remote code execution. An attacker crafts an HTTP POST request designed to exhaust memory at a precisely controlled point in PHP's initialization sequence. No authentication check, no WAF rule, no application firewall can stop it. The payload is processed entirely within PHP's own internals before a single line of your application code runs.
CVE-2026-109619: Stale Global State Reuse
PHP workers in persistent deployment modes (PHP-FPM, mod_php, LiteSpeed) serve multiple requests on the same worker process. Between requests, PHP is supposed to reset internal global state. CVE-2026-109619 is a failure of that reset: under specific conditions, request-scoped internal PHP state survives after its backing memory is freed. A subsequent request on the same worker reaches into that freed memory, achieving code execution.
Known trigger paths:
- PHP Session Upload Progress: enabled by default (
session.upload_progress.enabled=On). A multipart POST to any PHP endpoint triggers the stale-state reuse without requiring an application handler. - Fatal-error backtraces in PHP 8.5: a separate code path reaching the same condition. PHP's interim guidance for 8.5 is to set
fatal_error_backtraces=0.
The PHP Foundation has publicly stated that additional exploit variants exist and have not been fully enumerated. Mitigations targeting specific trigger paths are incomplete. Do not rely on blocking Session Upload Progress alone.
Why application-layer defenses don't apply to either CVE: Both vulnerabilities fire during PHP runtime initialization, before the request reaches any router, middleware, or authentication handler. WordPress, Drupal, Laravel, custom apps with full input validation: all equally exposed. The attack surface is PHP itself.
Scope & Affected Configurations
| Deployment Mode | Status | Notes |
|---|---|---|
| Apache mod_php | Affected | Reproduced by researchers |
| PHP-FPM | Affected | Reproduced by researchers |
| Other SAPIs | Check vendor advisory | Any unpatched PHP serving HTTP should be treated as exposed |
AWS lists PHP 5.4 through 8.1 as affected end-of-life branches, so the vulnerable code dates back roughly 14 years.
The EOL Problem Is Worse Than It Looks
PHP 8.2.35, 8.3.36, 8.4.27, and 8.5.12 are the fixed releases. That covers currently supported branches only:
- PHP 7.4, 8.0, 8.1: minimal source backports only, for people who build from source. No official tarballs or binaries.
- Amazon Linux: Amazon's advisory marks the AL2 core
phppackage and AL2023php8.1as No Fix Planned. AL2023 php8.2 through php8.5 and the AL2 php8.2 extra are marked Fixed. - Other distributions and LTS vendors may ship backports for older branches. Check your vendor's advisory.
Security vendor Mallory counted Shodan banners on October 20 and found about 59% of hosts that advertise a PHP version are on a branch that gets no official patch. Forrester repeated the figure in its briefing. These are banner counts, not confirmed vulnerable systems, and some of those hosts run backported packages.
The Embargo Collapse
Coordinated disclosure was originally set for October 22, 14:00 UTC. After details leaked, the PHP Foundation moved the release forward one day to October 21.
Timeline of the disclosure
October 17 to 21, 2026
- Pre-Disclosure Attempt Detected Amazon's MadPot honeypot network records an exploitation attempt four days before release. Amazon says it came from an IP address tied to a commercial anonymization network and called it largely a one-off probe. How the actor got exploit details before disclosure is still unknown. Oct 17, 2026
- CVE Identifiers and PoC Video Leak According to the PHP Foundation, the two CVE IDs circulated publicly, followed by an accidentally published proof-of-concept video. The Foundation moves the release forward by one day. Oct 20, 2026
- Attempts From Multiple Actors Amazon flags further attempts from around 02:00 UTC, coming from several anonymized IPs, which it says suggests more than one threat actor. Oct 21, ~02:00 UTC
- Cloudflare WAF Rules Go Live Cloudflare, which had built protections in early October, enables them by default for WAF customers about nine hours before disclosure. Oct 21, 03:02 UTC
- Chainguard Ships Patched Images Early Chainguard publishes patched PHP container images about six hours before the coordinated release. The PHP Foundation says this broke the embargo. Chainguard's CEO Dan Lorenc says the company acted because security vendors were reporting exploits in the wild, and apologised for the added stress on maintainers. Oct 21, 07:41 UTC
- Official PHP Patches Released PHP 8.2.35, 8.3.36, 8.4.27, and 8.5.12 are published. Cloudflare adds further rules during the day as attackers change payloads to evade them. The Dutch House of Representatives (Tweede Kamer) and other organisations take sites offline as a precaution. Oct 21, 14:00 UTC
Exploitation in the Wild
Status as of October 23, 2026:
- watchTowr reports exploitation attempts seen in its honeypots. CISA and the Dutch NCSC said they had not observed active exploitation as of October 21.
- Millions of attempts have been reported, but no confirmed breach so far. These bugs can leave few traces, so a quiet log is not proof of safety.
- Cloudflare saw attackers changing payloads to get around its rules and kept updating them.
VulnCheck says the bugs can be exploited for RCE on ARM64 and on x86 systems without ASLR, and that none of the public PoCs it reviewed bypass ASLR on x86-64. Datadog's researchers say a calibrated memory layout can bypass ASLR. Treat hardened systems as exposed until patched.
What To Do
Update within your current branch. A minor version bump is near-zero-risk for application compatibility and is the fastest safe path.
PHP 8.2.x → 8.2.35 | PHP 8.3.x → 8.3.36 | PHP 8.4.x → 8.4.27 | PHP 8.5.x → 8.5.12
Why not jump straight to 8.5.12? You can, and if your team has capacity it is the better long-term position. But a major version upgrade (8.2 → 8.5) is a project: deprecated functions removed, extension compatibility to verify, framework PHP matrices to check. For a security emergency, the smallest change is the safest. Patch within your branch first and plan the major upgrade separately.
There are no official binaries for your branch. In priority order:
1. Upgrade to a supported branch, ideally PHP 8.5.12. This is the only complete fix.
2. Use a backport from your distribution or LTS vendor as a bridge while you upgrade, if one exists for your platform.
3. As a temporary control only: set session.upload_progress.enabled=0 in php.ini or server config (not via ini_set() or .user.ini), and on PHP 8.5 set fatal_error_backtraces=0, then restart PHP workers. PHP warns these settings do not make an installation safe, and they do nothing for CVE-2026-109618.
Update the php8.2 to php8.5 packages on AL2023, or the php8.2 extra on AL2; Amazon marks these as fixed. Amazon's advisory marks the AL2 core php package and AL2023 php8.1 as No Fix Planned. If you run either, move to one of the fixed packages.
What Does Not Work
- Application-level authentication: the exploit fires before your code runs
- WAF rules alone: attackers change payloads to evade rules, and a WAF does nothing if your origin can be reached directly
- Multipart POST filtering toolkits: useful as a stopgap, but the maintainers of tools such as syhunt/php2shell-protection say in their own README that they are not a complete mitigation
- IP blocking: observed attempts came through anonymization networks
session.upload_progress.enabled=0alone: closes one confirmed CVE-2026-109619 path; does nothing for CVE-2026-109618, and PHP warns other variants exist
The Bigger Picture
PHP2Shell is not a new class of bug. Cleanup running on half-initialised state and request state surviving between requests are memory-safety issues that C runtimes have dealt with for decades.
The attack surface is the runtime, not the application. Most PHP security reviews look at application code. These bugs sit in the interpreter, so a well-written application on an unpatched runtime is still exposed.
The vulnerable code is old. It reaches back to PHP 5.4 and survived many major versions. Age and wide use are not the same as correctness.
The disclosure timeline did not hold. Leaks forced an early release, and attempts were recorded before patches existed. For software that runs a large part of the web, that is worth planning for: assume the window between leak and exploit can be hours.
| Question | Answer |
|---|---|
| Is this being exploited? | Attempts, yes, starting Oct 17. No confirmed breach reported so far |
| Do app-layer controls help? | No. The bugs are in the PHP runtime, not your code |
| Is a WAF enough? | No. Attackers changed payloads to evade rules on day one |
| Can I just disable Session Upload Progress? | Partial. Closes one known CVE-2026-109619 path; CVE-2026-109618 unaffected |
| Does PHP 7.4 / 8.0 / 8.1 get a patch? | Source backports only, no official binaries. Upgrading is the complete fix |
| Is Amazon Linux affected? | Yes. php8.2 to php8.5 packages are fixed; AL2 core php and AL2023 php8.1 are marked No Fix Planned |
Sources
- AWS Security Bulletin, PHP web runtimes (CVE-2026-109618 and CVE-2026-109619)
- Amazon Linux Security Center, CVE-2026-109618 package status
- Cloudflare, Cloudflare deploys protections against php2shell vulnerability
- VulnCheck, php2shell vulnerabilities
- Datadog Security Labs, php2shell: critical vulnerabilities in PHP
- syhunt, php2shell-protection README