PHP2Shell: The Flaw Before Application Code
The highest risk sits in mod_php, not in every PHP install. Knowing which module actually serves requests comes before any upgrade.

On this page
The PHP team released an emergency patch on October 21, 2026, at 14:00 UTC, one day ahead of the scheduled October 22 release. The decision followed the public circulation of CVE identifiers before the embargo period ended. The release addressed two vulnerabilities collectively known as PHP2Shell: CVE-2026-109618 and CVE-2026-109619. Both represent unauthenticated remote code execution (RCE) flaws with a CVSS 4.0 score of 9.2. The flaws were reported by security researchers Calif, OpenAI, and Wiz.
What prompted a closer reading of the advisory was not the score, but a specific note in the PHP release: the highest risk exists in mod_php, with exploits already demonstrated where unauthenticated requests can trigger attacks before any application code executes. This distinction separates two architectures often grouped under the generic label “PHP server.” Servers running Apache with mod_php and servers running nginx with php-fpm face different exposure profiles.
Requests ending abnormally
The root cause for both vulnerabilities is the same: PHP can leave memory in a corrupted state when a request ends abnormally. For Out-Of-Memory (OOM) situations, PHP uses longjmp() to jump out of the current execution context. There is a window where request memory is still accessible before initialization completes; if allocation fails at that precise moment, PHP does not account for the premature exit and leaves an invalid state. The subsequent request shutdown procedure then reads or branches on that state. The failed allocation does not need to be related to the invalid memory itself.
CVE-2026-109618 follows this OOM path. The advisory outlines three ways a request can hit OOM while appearing to stay within PHP limits:
- Multipart requests without a usable content length, allowing them to bypass initial
post_max_sizechecks while still sending a decoded body. - Single multipart parts with an unlimited number of headers. The memory representation of these headers significantly exceeds their size on the wire, allowing requests under
post_max_sizeto exhaust thememory_limit. - Empty file controls that are not counted toward
max_file_uploadsbut still create metadata arrays, combined with nested field names that multiply the work required for the resulting array.
OOM can also be triggered through application-specific patterns, where attacker input causes massive allocations or repeated memory consumption. CVE-2026-109619 takes a different path, utilizing stale global state between requests, which can lead to heap use-after-free, memory disclosure, and arbitrary code execution with the permissions of the web server process.
mod_php and php-fpm risk profiles
Apache mod_php invokes the request shutdown procedure unconditionally, even when request startup fails. During startup, automatic body parsing can exhaust the memory_limit and exit in a context where the state is temporarily invalid—and shutdown still processes that state. This entire chain occurs before any application code executes. Consequently, middleware, input validation, and framework-level rate limiting are bypassed entirely.
php-fpm terminates earlier: if request startup fails, the child process exits immediately, preventing the consumption of the invalid state and removing the child from the pool. However, this does not imply safety. Source analysis supports the conclusion that php-fpm stays susceptible after a successful startup—OOM can still be reached in contexts that do not account for early exits, resulting in the invalid state being processed during shutdown. No full exploit has been publicly demonstrated for this SAPI.
FrankenPHP invokes shutdown unconditionally, similar to mod_php, suggesting it is likely vulnerable to non-application-dependent attacks, though this remains unverified. LiteSpeed’s LSAPI mimics the php-fpm model, so application-dependent exploits are theoretically possible, also unverified. php-cgi is on the affected list too.
The technical fix
The patch removes longjmp() for OOM and replaces it with a two-stage process: a delayed soft OOM triggered at the next VM safe point, followed by a hard OOM via _exit() if memory consumption exceeds a second, higher threshold. This ensures the shutdown procedure no longer observes an invalid state, while maintaining PHP’s ability to enforce memory limits.
Versions containing the fix: 8.5.12, 8.4.27, 8.3.36, and 8.2.35. PHP 8.1 and older no longer receive updates from the PHP project. The team provided minimal source backports for 7.4, 8.0, and 8.1, and various distributions and LTS vendors provide their own patches.
Interpreting the 9.2 score
The vector is AV:N/AC:H/AT:P/PR:N/UI:N. It implies network access, no credentials, no user interaction, but with High Attack Complexity and additional conditions that must be met. This score does not mean every unpatched server is immediately accessible. It means the attack originates from the network without credentials and, in the case of mod_php, without needing to touch application code. This is sufficient justification to prioritize patching.
Verification steps
This is the order I follow before touching any packages. The level of exposure is determined not just by the version number, but by the SAPI actively in use.
php -vto check the running version.php -i | grep -i "server api"to identify the SAPI—fpm-fcgi,apache2handler, etc.php -mto list active extensions to identify what might be lost after an upgrade.dpkg -l | grep phpandapt policy php8.3-fpmto identify installed packages and available versions.apt changelog <package-name>to verify that CVE-2026-109618 and CVE-2026-109619 are explicitly mentioned in the distribution’s changelog.
The final point is often overlooked. Distribution package version numbers like 8.3.6-0ubuntu0.24.04.x do not map directly to upstream numbers; security patches are often applied as backports. Reading the package changelog is more reliable than inferring from version strings.
Safe upgrade sequence
Restarting php-fpm terminates all currently running requests, so the sequence must be intentional:
- Create a snapshot or backup before making any changes.
- Test in a staging environment using the same package versions.
- Upgrade the packages and restart the service:
systemctl restart php8.3-fpm. - Inspect
systemctl status php8.3-fpm, PHP error logs, and pages that utilize uploads or sessions. - If extensions are missing or the application throws errors, revert to the previous package and examine the logs before retrying.
For high-traffic sites, perform the restart during low-activity hours. Several seconds of downtime during a restart is not a process failure; the issue is restarting without knowing what to verify afterward.
Status as of November 3, 2026
Both CVEs were added to the CISA KEV catalog on October 30, 2026, confirming active exploitation. Palo Alto Networks confirmed attacks targeting PAN-OS management interfaces. The Cyber Security Agency (CSA) of Singapore issued warnings covering Cisco, Citrix, F5, and Siemens products. Synology released patch Synology-SA-26:14 for PHP 7.3–8.4, Mail Station, and Calendar. No reports of mass compromise have been confirmed as of this writing.
The lesson here is that web servers are not the only concern. Network appliances and NAS devices running PHP behind management interfaces fall under this category.
Mitigation limitations
WAFs can block specific payloads but do not patch the PHP engine. Disabling one endpoint does not mitigate the mod_php path because the attack executes before application routing. Limiting requests or worker counts reduces the window of opportunity but does not eliminate the flaw. Disabling file uploads only narrows one OOM path, while multipart and header paths remain. Assuming php-fpm is inherently secure is a costly error; the difference lies in how far an attacker can reach, not whether they can reach at all.
Two takeaways remain from this event. First, knowing the SAPI is a prerequisite for incident response, not something to determine during the incident. Second, subtle differences in low-level implementation—like an unconditional shutdown function—can dictate whether an attacker needs to bypass application code or not.