Out-of-memory handling leaves request state uninitialised or dangling, which the engine later reads. The result is memory corruption, leaked data and code execution.
Use-after-free in the session upload-progress feature (on by default) and related fatal-error paths. Any endpoint that accepts multipart requests is reachable.
01Executive Summary
On 21 October 2026, the PHP project shipped emergency security releases for two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619. The CVE identifiers leaked a day before the scheduled release. Wiz Research found and reported the flaws and named the class PHP2Shell. Both are rated CVSS v4.0 9.2 (Critical); some early coverage cited 10.0.
Wiz showed unauthenticated remote code execution against default wordpress:latest, drupal:latest and joomla:latest container images. The CMSs themselves are not the cause. They are just representative PHP applications, and any PHP workload on an affected build is exposed.
PHP runs most of the public web: CMSs, e-commerce stores, customer portals, internal tools and countless vendor appliances with embedded web UIs. Exploitation needs no credentials, no particular plugin and no application-level bug. Cloudflare said it was already seeing early attacks before patches shipped, and the UK NCSC told organisations to update immediately or take systems offline.
02What the Vulnerabilities Are
| Attribute | CVE-2026-109618 | CVE-2026-109619 |
|---|---|---|
| Type | Memory corruption via uninitialised / dangling state after an out-of-memory (OOM) abort | Use-after-free (CWE-416) in session upload-progress and fatal-error handling |
| Impact | RCE; memory disclosure (secrets from other requests) | RCE |
| CVSS v4.0 | 9.2 (Critical) | 9.2 (Critical) |
| Authentication | None (pre-auth) | None (pre-auth) |
| Precondition | Attacker can push a worker to its memory_limit (e.g. large multipart bodies) | session.upload_progress.enabled = On (the default) and an endpoint that accepts multipart requests, even one that ignores uploads |
| Exploited in wild | Early attacks reported; lab reproductions public | Early attacks reported; PoC reported |
2.1 The root cause: state that outlives the request
PHP is designed around a "share-nothing" model. Every HTTP request gets a fresh request heap, and everything is torn down at the end. In production, though, the process survives. A single PHP-FPM, mod_php or FrankenPHP worker serves thousands of requests one after another.
PHP2Shell targets what happens when a request ends abnormally. When a fatal error fires, most notably "Allowed memory size exhausted", the engine uses longjmp() to jump straight to request shutdown. That skips the normal clean-up code, so some global pointers are left pointing into memory that has just been freed. The worker keeps running, and the next request on it inherits those stale pointers. Whoever controls what fills that freed memory can then influence what the engine does with it.
2.2 CVE-2026-109618 — the out-of-memory path
This is the more general of the two. Any code path that can drive a worker to its memory_limit can trigger the abort. The cheapest trigger from the outside is simply volume: a large request body, a deeply nested structure, or a payload the application decodes into a big in-memory object. When allocation fails, the engine raises the fatal OOM error and unwinds.
The problem is that the OOM unwind runs while the heap is already exhausted. Several allocations that shutdown would normally make cannot be made, and several structures that shutdown would normally reset are left half-initialised or already freed. On the next request the engine reads those structures as if they were valid. Depending on what the attacker arranges to allocate into the reclaimed memory, the outcome ranges from an information leak — bytes belonging to a previous request, such as another user's session token, Authorization header or form data — to full control-flow hijack. The information-leak case is what makes 109618 especially nasty: even a partial, "unreliable" exploit can bleed secrets across request boundaries on a shared worker.
2.3 CVE-2026-109619 — use-after-free in session upload-progress
PHP ships a feature called session upload-progress that lets an application poll how far a file upload has got. It is controlled by session.upload_progress.enabled, which is On by default. Critically, it activates purely on the shape of the request: if a multipart body contains a field named by session.upload_progress.name (default PHP_SESSION_UPLOAD_PROGRESS), the engine starts tracking progress — even if the target script never reads uploads at all. A static-looking endpoint, a login form, a health-check URL: any of them will do, as long as PHP handles the POST.
The tracking structure is tied to the session and updated as body parts arrive. Under a fatal error mid-parse (easily combined with the 109618 OOM trigger, or provoked on its own with a malformed body), the structure is freed but a reference to it survives into later processing. That dangling reference is a classic use-after-free (CWE-416): free the object, then get the engine to allocate attacker-chosen data into the same slot, then get the engine to use the stale reference. Because the attacker controls both the session key and the upload field contents, they control both when the object is freed and what replaces it — the two things a UAF exploit needs most.
109618 gives an attacker a reliable way to force a fatal error at a chosen moment; 109619 gives a freed object whose contents and lifetime the attacker already controls. Wiz's end-to-end demonstrations against stock WordPress, Drupal and Joomla images combined both into a single unauthenticated request flow.
03Impact & Attack Scenarios
The practical ceiling for both bugs is remote code execution as the web/PHP user, with no credentials and no application vulnerability required. From that position an attacker can do everything the PHP worker can do, and more by pivoting:
- Full server compromise — drop a web shell, add a cron job, or load a malicious extension; persist across restarts.
- Data theft — read application config (DB credentials, API keys, .env), dump databases, exfiltrate customer data.
- Cross-request secret disclosure — via 109618's memory leak, harvest session tokens, cookies and headers belonging to other users served by the same worker, enabling account takeover even without full RCE.
- Lateral movement — use the host as a foothold into internal networks, cloud metadata endpoints and connected services.
- Supply-chain & mass exploitation — because the bug is version-keyed rather than app-keyed, the same payload works across millions of unrelated sites. This is ideal for automated, internet-wide scanning and cryptominer/botnet deployment.
- Denial of service — even without achieving RCE, reliably crashing workers (the OOM/UAF path) can take an application offline.
04Affected & Fixed Versions
The flaws live in the Zend engine and the bundled session module, so every web SAPI is affected: PHP-FPM, Apache mod_php, CLI server, and modern runtimes such as FrankenPHP and Swoole that keep workers resident. All supported branches received fixes on 21 October 2026; older, end-of-life branches (7.x and earlier, plus 8.0/8.1) are affected and will not get official patches.
| Branch | Status | Fixed in | Action |
|---|---|---|---|
| PHP 8.5 | Affected | 8.5.12 | Upgrade now |
| PHP 8.4 | Affected | 8.4.27 | Upgrade now |
| PHP 8.3 | Affected | 8.3.36 | Upgrade now |
| PHP 8.2 | Affected | 8.2.35 | Upgrade now |
| PHP 8.1 & older | EoL — affected | No official fix | Migrate to a supported branch, or rely on distro backports |
If you install PHP from an OS vendor (RHEL/Alma/Rocky, Debian, Ubuntu, Amazon Linux) the fixed upstream number will differ from your package version — vendors backport the patch into their own build string. Confirm the fix by your distro's advisory (e.g. the RHSA/DSA/USN), not by comparing to 8.3.36. Containers are the fastest win: rebuild FROM php:8.3 after the base image is refreshed and redeploy.
05Am I Affected?
Assume yes if you run any internet-reachable PHP on an unpatched build. To scope it quickly:
# 1. What version is each host actually running? php -v # CLI version can differ from the FPM/Apache SAPI that serves traffic: php-fpm -v # Or ask the running service over HTTP (if a phpinfo/status page exists — then remove it) # 2. Is the default-on upload-progress feature enabled? (relevant to 109619) php -i | grep -i session.upload_progress session.upload_progress.enabled => On => On # 3. Inventory across a fleet: list installed php packages / container base # tags and compare to the fixed-versions table above.
Priority targets for immediate attention: public CMS installs (WordPress, Drupal, Joomla, Magento), customer portals, API gateways written in PHP, and vendor appliances that embed a PHP web UI (these are routinely months behind and often overlooked).
06Mitigation & Remediation
There is no configuration that makes an unpatched build safe. Disabling upload-progress reduces exposure to 109619 but leaves 109618. Patching is the only real fix.
Upgrade to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 or your distro's equivalent backport. For containers, refresh the base image and redeploy. After upgrading, restart the SAPI (systemctl restart php-fpm / reload Apache) — resident workers keep the old, vulnerable code in memory until they recycle.
Set session.upload_progress.enabled = Off (blunts 109619). Lower memory_limit toward real need and cap body size at the proxy (client_max_body_size in nginx, LimitRequestBody in Apache) to make the OOM trigger harder. Put a WAF rule in front of the PHP_SESSION_UPLOAD_PROGRESS field. These are stop-gaps, not fixes.
Lower pm.max_requests so FPM children respawn more often, shrinking the window a stale pointer survives. Helpful hardening, not protection.
Confirm the running SAPI reports a fixed version, then assume-breach for any host that was exposed and unpatched: review logs for memory-exhaustion errors and worker crashes, check web roots and cron for implants, rotate credentials and session secrets reachable from the web tier, and check web roots and cron for implants.
07Disclosure Timeline
| Date (2026) | Event |
|---|---|
| Earlier in year | Wiz Research discovers the PHP2Shell class and reports it privately to the PHP security team. |
| 20 October | CVE identifiers for 109618 / 109619 leak roughly a day ahead of the coordinated release. |
| 21 October | PHP ships emergency releases 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35; Wiz publishes the write-up and CMS demonstrations. |
| 21–24 October | Cloudflare reports early exploitation attempts; UK NCSC urges immediate patching; distro backports and PoCs circulate. |
| 26 October | This advisory. Mass scanning for unpatched hosts ongoing. |
08Conclusion
PHP2Shell stands apart from most critical vulnerabilities because it requires nothing from the application layer. No misconfiguration, no vulnerable plugin, no developer mistake — just an unpatched runtime build and a network path to it. That version-keyed exploitability is what turns this into an internet-scale problem: automated scanners do not need to understand your application, only the version string your server returns. Stop-gap measures — disabling upload-progress, tightening body-size limits, WAF rules, aggressive worker recycling — reduce the window but do not close it. The only answer is the unglamorous one: patch the interpreter, restart the workers, and assume any exposed unpatched host may already be compromised.
Treat this as a priority emergency change.
- Inventory — Identify every affected runtime build serving traffic, including vendor appliances, containers, and legacy hosts that are easily overlooked.
- Patch & restart — Update to the fixed versions and restart the web service. Resident workers keep vulnerable code in memory until they recycle.
- Assume breach for exposed hosts — For any host that was internet-facing and unpatched, review logs for worker crashes, audit web roots and scheduled tasks for implants, and rotate credentials and session secrets reachable from the web tier.
Cytomate's security operations team can help you identify blind spots across your server estate, confirm remediation across distributed environments, and maintain continuous visibility as exploitation activity evolves.
Cytomate Threat Intelligence. Classification TLP:CLEAR · Report date 26 October 2026. This advisory is provided for defensive and informational purposes. Version numbers, scores and timeline details are drawn from public reporting available at the time of writing and may be refined as more information emerges. Validate fixed versions against your own vendor's advisory before relying on them.
