Skip to content

CVE-2026-109618: PHP Core Multipart/Form-Data Parser Use-After-Free Unauthenticated Remote Code Execution (PHP2Shell)

Density:
HASS

HERMES THREAT SCORE

Confidence: 90%
0 / 100
MINIMAL

Measures specific systemic risk arising from autonomy, tool authority, and cascading execution.


CVE-2026-109618 represents one of the most dangerous vulnerabilities disclosed in the history of the web runtime stack. Affecting all PHP versions from PHP 5.4.0 through PHP 8.4, the vulnerability resides in the core C implementation of the PHP request parsing engineโ€”specifically within the handler responsible for processing incoming multipart/form-data request bodies (RFC 1867).

Crucially, PHP processes multipart request bodies before any user-space application code, framework logic, or in-application Web Application Firewall (WAF) can execute. An unauthenticated attacker sending a single specially crafted HTTP POST request over standard HTTP/HTTPS ports (80, 443) can trigger a Use-After-Free (UAF) condition in the Zend Engine memory allocator, hijack control flow, and achieve arbitrary remote code execution with the permissions of the web server worker process (www-data, apache, nginx, or SYSTEM).

graph TD
Attacker([Adversary / Automated Botnet]) -->|HTTP POST with Malformed multipart/form-data| EdgeServer[Web Server: Nginx / Apache / IIS]
EdgeServer -->|Forward to SAPI / FastCGI| PHPRuntime[PHP Core Engine: php-fpm / mod_php]
subgraph "PHP Core Pre-Execution Phase"
PHPRuntime -->|Early Request Ingestion| MultipartParser[RFC 1867 Multipart Parser]
MultipartParser -->|Boundary Chunk Desync| ZendAllocator[Zend Memory Manager / emalloc]
ZendAllocator -->|UAF Dangling Pointer Dereference| HeapCorruption[Control Flow Hijacking]
end
HeapCorruption -->|Arbitrary Code Execution| WebShellSpawn[Spawn Reverse Shell / Implant]
subgraph "Application Layer (Never Reached)"
AppFramework[WordPress / Drupal / Magento / Laravel]
AppWAF[Application WAF / Plugin Filters]
end
classDef danger fill:#fee2e2,stroke:#ef4444,stroke-width:2px;
classDef bypass fill:#fef3c7,stroke:#f59e0b,stroke-width:2px;
class MultipartParser,ZendAllocator,HeapCorruption,WebShellSpawn danger;
class AppFramework,AppWAF bypass;

Coordinated research by Wiz Research, Calif (Patch the Planet / OpenAI), and The PHP Foundation established that CVE-2026-109618 unifies two devastating exploitation primitives in the low-level SAPI layer:

1. Pre-Auth RCE Primitive: Upload-Progress Unserializer Use-After-Free (BG(unserialize))

Section titled โ€œ1. Pre-Auth RCE Primitive: Upload-Progress Unserializer Use-After-Free (BG(unserialize))โ€

When an incoming multipart/form-data request is received, PHP parses MIME boundaries in main/rfc1867.c.

  • If upload progress tracking is active (session.upload_progress.enabled = 1), PHP deserializes session state during early request bootstrapping.
  • Internal unserializer bookkeeping is kept in the global executor variable BG(unserialize).
  • If the adversary crafts boundary markers that trigger an out-of-memory (OOM) fatal error, execution halts and the request heap is destroyed via zend_mm_shutdown().
  • However, BG(unserialize) remains pointing to freed memory.
  • When the same worker handles a subsequent request, PHP consumes this dangling state. By reclaiming this slab with attacker-controlled data (heap spraying), the adversary hijacks function pointers to achieve unauthenticated remote code execution (demonstrated on WordPress, Drupal, and Joomla).

2. Process Memory Leak Primitive: Remote Heap Disclosure (Heartbleed-Style)

Section titled โ€œ2. Process Memory Leak Primitive: Remote Heap Disclosure (Heartbleed-Style)โ€

This primitive enables remote unauthenticated extraction of live process memory without code execution:

  • During multipart startup, upload progress handling publishes a session ID into PS(id).
  • An OOM abortion destroys the request heap, leaving PS(id) pointing to freed memory.
  • A later multipart request handled by the same worker reaches the upload-progress cleanup path before normal session initialization resets that pointer.
  • PHP trusts the stale pointer and length as a live zend_string and URL-encodes reclaimed heap contents into the Set-Cookie: PHPSESSID=... response header.
  • This leaks database credentials, AWS/GCP cloud tokens, API keys, and session cookies from concurrent requests, even if the web application never calls session_start().


Ground-truth threat telemetry confirms widespread weaponization:

  1. Pre-Disclosure Exploitation (October 17, 2026): Telemetry from AWSโ€™s global MadPot honeypots identified targeted exploit probes originating from commercial anonymization networks 4 days ahead of the scheduled public disclosure.
  2. Post-Embargo Scanning Surge: Following embargo lift at 14:00 UTC on October 21, sensors operated by GreyNoise, SANS ISC, and ProjectDiscovery recorded a multi-fold increase in scanning payloads hitting endpoints blindly.
  3. Deceptive Zero-Logging Phenomenon: Because PHPโ€™s multipart parser executes before application frameworks or user-space logging code, malicious requests frequently return normal HTTP 200 responses with zero application-level error logging.

The upstream patch engineered by the PHP Security Team replaces unsafe graceful cleanup with a robust dual-boundary memory control model:

  • Soft Memory Limit: When request parsing approaches the soft limit, OOM exceptions are deferred until the Zend hash table bucket insertions reach an atomic safe point. This guarantees hash bucket counters match allocated key/value pointers.
  • Hard Memory Limit: If the memory hard limit is strictly breached, the worker process is terminated immediately via _exit(137). This deliberately avoids calling zend_mm_shutdown(), preventing attackers from exploiting uninitialized or freed request pointers.

AWS WAF released static version 2.3 of the PHP application managed rule group:

{
"Name": "AWSManagedRulesPHPRuleSet",
"Version": "2.3",
"Rule": "PHP2Shell_BODY",
"Action": "Block"
}

Inspects request bodies for oversized, malformed multipart boundaries designed to induce out-of-memory states.

Universal Surface Area

PHP powers over 77% of all websites with a known server-side programming language, including WordPress, WooCommerce, Drupal, Joomla, Magento/Adobe Commerce, Shopware, Nextcloud, and cPanel.

Zero-Click Pre-Authentication

No login credentials, session cookies, or valid accounts are required. Any open endpoint that accepts HTTP POST requests is instantly exploitable.

Exploit Weaponization Leak

The leak of the offensive PHP2Shell utility by Calif.IO and verification by labs like watchTowr means threat actors and botnet operators already have functional primitives.

Orphaned EOL Installs

Only actively supported branches (PHP 8.2, 8.3, 8.4) will receive official patches. Millions of legacy systems on PHP 5.x, 7.x, 8.0, and 8.1 will remain vulnerable indefinitely without backports.


Because official patches are scheduled for deployment on Wednesday, October 21, 2026, security administrators must implement immediate infrastructure-level defenses.

Reject all requests containing multipart/form-data before they ever reach the PHP runtime.

# Add inside every server {} block that routes to PHP
if ($http_content_type ~* "multipart/form-data") {
return 403;
}

Run nginx -t && systemctl reload nginx immediately.

If your application can tolerate browsing without state modifications, reject all HTTP methods except GET and HEAD:

if ($request_method !~ ^(GET|HEAD)$) {
return 503;
}

Disable upload progress tracking and enforce strict session modes across all PHP-FPM pools:

; In php.ini or drop-in conf.d/99-emergency.ini
session.upload_progress.enabled = 0
session.use_strict_mode = 1

In PHP-FPM pool configs (/etc/php/*/fpm/pool.d/www.conf):

php_admin_flag[session.upload_progress.enabled] = off
php_admin_flag[session.use_strict_mode] = on

Monitor PHP worker processes (php-fpm, php-cgi, apache2, httpd) for suspicious child process generation:

title: Suspicious Child Process Spawned by PHP Runtime (PHP2Shell)
id: c5d8e2a1-7b94-4321-9988-112233445566
status: critical
description: Detects interactive shells, script interpreters, or download utilities spawned by PHP workers following CVE-2026-109618 exploitation.
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/php-fpm'
- '/php-fpm8.2'
- '/php-fpm8.3'
- '/php-fpm8.4'
- '/php-cgi'
- '/apache2'
- '/httpd'
- '/nginx'
selection_child:
Image|endswith:
- '/sh'
- '/bash'
- '/dash'
- '/zsh'
- '/python'
- '/python3'
- '/perl'
- '/curl'
- '/wget'
- '/nc'
- '/ncat'
- '/netcat'
- '/busybox'
condition: selection_parent and selection_child
falsepositives:
- Legitimate administrative cron scripts or video encoding tools invoked directly via proc_open() in specific applications.
level: critical
tags:
- attack.initial_access
- attack.t1190
- attack.execution
- attack.t1059.004

Threat Intelligence & Observed Indicators of Compromise (IOCs)

Section titled โ€œThreat Intelligence & Observed Indicators of Compromise (IOCs)โ€
Indicator TypeObservable / IndicatorRole / AttributionFirst ObservedStatusSource
IPv4 Address92.118.112[.]100Exploit staging & automated probe delivery2026-10-17ACTIVEAmazon MadPot
IPv4:Port45.115.26[.]26:8000Secondary payload staging server2026-10-21ACTIVEArctic Wolf CTI
IPv4 Address45.198.224[.]169Reverse shell listener / C2 ingress2026-10-22ACTIVEArctic Wolf CTI
Subnet Range5.175.189[.]0/24Potassium botnet distributed scan node cluster2026-10-22ACTIVEwatchTowr Labs
File SHA-256e2529d4afa39ae4db2eb05d5176317c906289abf09660c75bdeec43e54c55aa3Secondary stage reverse shell dropper2026-10-22ACTIVEwatchTowr Labs
File SHA-2560c5486f06620e26e316f4b33f318b0d646d5e1133789331aa2fed012360d1486Obfuscated PHP webshell implant (.sess_...)2026-10-22ACTIVECyfirma CTI
  • Spike in PHP Out-of-Memory Errors: Syslog / PHP-FPM error logs recording sudden bursts of Allowed memory size of ... bytes exhausted (tried to allocate ... bytes) immediately preceding worker segfaults or restarts.
  • Worker Process Anomalies: Worker processes running as unprivileged accounts (www-data, apache, nobody) performing immediate outbound TCP connections to unassigned ports (e.g., 8000, 4444, 1337) or invoking child shell processes.

๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-109618: PHP Core Multipart/Form-Data Parser Use-After-Free Unauthenticated Remote Code Execution (PHP2Shell)VULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTFortinet FortiOS Gateway
98% VERY_HIGH

Software platform affected by security vulnerabilities and agentic attack patterns.

๐Ÿ” Why is this related? (Evidence & Provenance)

“Confirmed security vulnerability in Fortinet FortiOS Gateway documented in Hermes dossier.”

Supporting Verified Evidence:
C-Level Executive Briefing HERMES-SEC-BRIEF HIGH
Generate Executive Briefing Sheet (Print / PDF)