跪拜 Guibai
← All articles
PHP · Security · Operations

PHP2Shell: Two Unauthenticated PHP RCEs at CVSS 9.2 Need a Runtime Fix, Not a CLI Upgrade

By manageengine ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

An unauthenticated request can execute code on any public PHP deployment below the fixed versions, with more than a million exposed servers already counted. The trap is that upgrading the CLI binary changes nothing for the FPM or mod_php process actually serving traffic, so incident response has to start by identifying the real web SAPI and version.

Summary

On 2026-10-21, PHP patched and disclosed two high-severity remote code execution vulnerabilities under the name php2shell. CVE-2026-109619 is a use-after-free in request-owned internal state; CVE-2026-109618 is memory corruption triggered when an out-of-memory interruption leaves request data half-initialized. Both allow unauthenticated access before application code runs, and a PoC is already circulating, pushing the CVSS v4.0 score to 9.2. Apache mod_php deployments face the highest verified risk, but PHP-FPM, php-cgi, FrankenPHP, and LiteSpeed are all in scope, which puts WordPress, Drupal, Laravel, Symfony, and similar stacks on the list purely because their PHP runtime is exposed.

Patching the CLI binary does not patch the web process. Teams must check the actual SAPI with php -i and php-fpm -v, and verify which PHP version answers web requests. The only complete fix is moving to 8.5.12, 8.4.27, 8.3.36, or 8.2.35; for EOL PHP 8.1 and earlier, PHP provides minimal source backport patches for self-compilation. Temporary mitigations exist: php_admin_value[memory_limit] = -1 removes the OOM interruption path for CVE-2026-109618, and disabling session.upload_progress.enabled (plus fatal_error_backtraces on 8.5) closes the known use-after-free trigger. Those are explicitly partial, and application-level ini_set cannot be trusted as a mitigation because the correct settings must exist before SAPI startup.

At scale, the recommended loop is detect, prioritize, fix, mitigate, isolate, monitor, and harden. ManageEngine's Vulnerability Manager Plus, Endpoint Central, Log360, and PAM360 appear as one orchestration layer; priorities run public-facing over internal, mod_php over FPM/cgi, and EOL over near-fixed versions. The scale workflow also covers version confirmation, SAPI discovery, smoke tests, request-size limits that apply to chunked transfer, and credential rotation to block lateral movement.

Takeaways
— CVE-2026-109618 and CVE-2026-109619, code-named php2shell, are unauthenticated PHP RCEs with a CVSS v4.0 score of 9.2 and CNVD high-risk ratings.
— Fixed versions are PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35; PHP 8.1 and earlier receive only minimal source backport patches for self-compilation.
— CVE-2026-109619 is a use-after-free (CWE-416) in request-owned internal state; CVE-2026-109618 is OOM corruption where half-initialized request data is cleaned up as valid.
— Apache mod_php is the highest-risk deployment, with verified unauthenticated triggering; PHP-FPM, php-cgi, FrankenPHP, and LiteSpeed are also affected.
— The actual web PHP version can differ from the CLI version; check php -i and php-fpm -v and act on the web SAPI version, not the CLI output.
— For CVE-2026-109618, php_admin_value[memory_limit] = -1 set in php.ini, FPM pool, or Apache config removes the OOM interruption path; ini_set and .user.ini are request-level and too late.
— For CVE-2026-109619, set php_admin_value[session.upload_progress.enabled] = 0 before request parsing, add fatal_error_backtraces = 0 on PHP 8.5, and restart all workers.
— Temporary mitigations reduce specific attack paths; only upgrading to a fixed version is the complete solution.
— Response priority is public-facing assets before internal, mod_php before FPM/cgi, and EOL versions before versions near the fixed line.
— The scale workflow runs detection, prioritization, fixing, mitigation, isolation, monitoring, and hardening, with ManageEngine's Vulnerability Manager Plus, Endpoint Central, Log360, and PAM360 named as orchestration tools.
Conclusions

The same-day patch-and-disclose schedule is what makes this urgent: defenders and attackers get the technical details at the same moment, so the window before weaponized exploitation is measured in days, not months.

Checking php -v is a false assurance in many shops; operations teams routinely patch a CLI binary while FPM or mod_php keeps running the old runtime.

The OOM mitigation turns an anti-pattern into a targeted control: memory_limit=-1 removes the vulnerable interruption path, but only works when paired with request-size limits and cgroup boundaries, otherwise it becomes a DoS amplifier.

The seven-step scale framework works at the process level independent of tooling; ManageEngine's products are one possible orchestration layer, and the same loop can run on any patch management, monitoring, and PAM stack.

Concepts & terms
php2shell
Code name for the pair of PHP remote code execution vulnerabilities disclosed together on 2026-10-21: CVE-2026-109618 and CVE-2026-109619.
use-after-free (CWE-416)
A memory-safety flaw where a program continues using a pointer after the memory it references has been freed. In this incident, stale request state from a previous worker request is consumed before reset, enabling remote code execution.
OOM corruption
Memory corruption that occurs when PHP runs out of memory during an allocation and is interrupted; internal request data is only half-initialized, then cleanup treats invalid data as valid and creates an RCE path.
SAPI
Server Application Programming Interface: the layer that connects PHP to a web server, such as mod_php, PHP-FPM, or CGI. The SAPI in use determines the risk level and how configuration changes must be applied.
mod_php
An Apache module that embeds PHP directly into the web server process. Because it runs inside the request-handling process, it is the highest-risk deployment in this incident and requires an Apache restart after configuration changes.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗