The global PHP security team has issued an emergency set of updates to address two critical vulnerabilities that could allow unauthenticated attackers to execute arbitrary code on web servers. Released on October 21, 2026, the patches arrive as a direct response to a high-pressure situation involving a public leak of vulnerability details just one day before the scheduled maintenance window. The flaws, identified as CVE-2026-109618 and CVE-2026-109619, have both been assigned a high-severity score of 9.2 under the CVSS v4.0 framework, signaling a significant risk to the vast number of websites and applications powered by the PHP language.
The security release covers several active branches of the PHP engine, specifically versions 8.5.12, 8.4.27, 8.3.36, and 8.2.35. Because these vulnerabilities allow for remote code execution (RCE) without requiring any prior authentication, they represent the highest tier of threat for server administrators. The rapid response from the PHP core developers underscores the severity of the situation, particularly after details of the flaws began circulating online under the moniker "php2shell."
A High-Stakes Timeline and the "php2shell" Leak
The road to these emergency patches began on October 20, 2026, when the official PHP project announced an upcoming critical security release scheduled for the following day at 14:00 UTC. While such announcements are standard practice to allow administrators to prepare for downtime, the situation escalated rapidly when technical details of the vulnerabilities were leaked ahead of schedule. Security research firms, including Sansec and Huntress, quickly identified the circulating information and published warnings to the broader community.
The leak created a dangerous window of opportunity for threat actors to develop exploits before official fixes were widely available. Recognizing this, the PHP security team and the PHP CVE Numbering Authority (CNA) accelerated their processes. The official GitHub Security Advisories were published early on October 21, followed immediately by the formal CVE records. By the time the official binaries and source code updates were released, the community was already on high alert. While Linux distributions and Long-Term Support (LTS) vendors had received the patches in advance through private security channels, the public leak forced a slightly earlier-than-planned deployment for the general public.
Understanding CVE-2026-109618: Memory Corruption via Out-of-Memory Errors
The first of the two critical flaws, CVE-2026-109618, involves a fundamental issue with how PHP handles memory exhaustion. In the C programming language, which serves as the foundation for the PHP interpreter, developers often use a function called longjmp() to handle exceptional circumstances. When PHP runs out of memory (OOM), it uses this mechanism to immediately exit the current execution context and abort the web request.
However, technical advisories reveal that in certain specific contexts, request-related memory can become reachable by the system before it has been fully or properly initialized. If a memory allocation fails at this precise moment, the PHP engine does not properly account for the early exit triggered by the OOM condition. This leaves the request memory in an invalid, "half-initialized" state. Crucially, the failed allocation that triggers the crash does not even need to be directly related to the memory that is left corrupted.
The danger arises during the request shutdown procedure. As PHP attempts to clean up and close the request, it may read from or branch its logic based on this invalid data. An attacker can exploit this by carefully crafting a request that pushes the server into an OOM state while remaining within the apparent limits set by the server’s configuration. This is often achieved through multipart parsing paths, which are commonly used for file uploads and complex form data. By manipulating how the server processes these large or complex inputs, an attacker can induce the specific memory state required to trigger code execution.
The risk level for this vulnerability varies depending on the Server API (SAPI) being used. Systems running PHP as an Apache module (mod_php) are considered to be at the highest risk because the PHP interpreter shares the same process space as the web server itself. Other common configurations, such as PHP-FPM, php-cgi, FrankenPHP, and LiteSpeed, are also vulnerable, though the isolation of the FPM process provides a slightly different security profile. The fix implemented in the new PHP versions involves a significant change to how memory is managed: the longjmp() OOM exit has been removed and replaced with a "soft OOM" that waits for a safe point in the virtual machine execution, paired with a "hard OOM" that terminates the process if a second, higher memory threshold is reached.
CVE-2026-109619: Use-After-Free via Stale Global State
The second vulnerability, CVE-2026-109619, addresses a "use-after-free" scenario involving the global state of the PHP worker. In a typical high-performance environment, a single PHP worker process handles many different web requests in sequence. To maintain efficiency, some global states—such as error handlers, session information, and extension-specific data—persist within the worker process.
According to the official security advisory, this global state sometimes contains pointers to memory that was owned by a previous request. Under normal circumstances, this state must be reset or cleared before the memory from that request is released back to the system. If this reset fails to occur, the worker process may enter a "stale" state where it still holds references to memory that has already been freed.
Exploitation of this flaw generally requires two stages. First, an attacker must trigger a condition that leaves a pointer to freed memory in the global state. Second, they must trigger an operation in a subsequent request that uses that stale pointer before the next request has had a chance to fully initialize its own state. The PHP team has confirmed that certain consumers of this state, such as the fatal_error_backtraces feature in PHP 8.5 and certain session upload progress trackers, are particularly susceptible.
A specific area of concern involves how configuration values (INI settings) are handled in PHP-FPM. While standard php.ini values are usually applied when a worker starts, certain web server configurations (like those in Nginx or Apache’s mod_proxy_fcgi) can send PHP_VALUE or PHP_ADMIN_VALUE parameters to FPM for every request. If these values are deprecated or invalid, they can raise a diagnostic error during the early stages of a request, potentially touching the stale memory and allowing an attacker to gain control of the execution flow.
Assessing the Risk and Identifying Vulnerable Systems
The impact of these vulnerabilities is severe. Successful exploitation allows an attacker to execute commands on the server with the same privileges as the user running the PHP process (often www-data or a specific site user). This can lead to full site compromise, data theft, and the use of the server as a jumping-off point for further attacks within an internal network.
Every PHP installation serving web requests is potentially at risk. Administrators are urged to check their current versions immediately. On Debian and Ubuntu systems, this can be done by checking the installed packages via dpkg or by running php -v in the command line. It is also vital to identify which PHP-FPM services are currently active and whether the web server is passing specific PHP values to the backend.
While the primary fix is to update the PHP engine to the latest patched versions, the security team has identified several mitigations that can reduce exposure in the interim. For the OOM-related vulnerability, administrators might consider increasing the memory_limit to a very high value (or -1 for unlimited) to make it harder for an attacker to trigger an OOM state. However, this carries the risk of allowing a single malicious request to consume all available system RAM, potentially leading to a Denial of Service (DoS).
For the stale state vulnerability, disabling session.upload_progress.enabled and, on PHP 8.5 systems, setting fatal_error_backtraces to 0 can close off the most common attack paths. However, the PHP project is explicit: these mitigations are not a substitute for a full update, as they only address specific known vectors and do not fix the underlying memory management flaws.
The Role of Web Application Firewalls and Origin Security
In the wake of the "php2shell" leak, some security providers shared Web Application Firewall (WAF) rules designed to block requests targeting these flaws. For instance, a Cloudflare WAF rule was circulated to block requests containing the PHP_SESSION_UPLOAD_PROGRESS field in the request body. While such rules provide a valuable layer of defense, they have significant limitations.
A major concern is that WAF rules only protect traffic that passes through the firewall. If a server’s "origin" IP address is exposed, an attacker can bypass the WAF entirely by connecting directly to the server. Furthermore, a WAF rule targeting a specific field like upload progress does nothing to protect against the OOM-based vulnerability or the risks associated with the INI configuration path. Administrators are reminded to ensure their servers only accept traffic from their WAF’s IP ranges to prevent these types of bypasses.
Implementation in the Field: A Practical Perspective
Real-world deployment of these patches often involves navigating complex server environments. For many administrators, the discovery of these critical flaws also reveals other maintenance gaps. For example, some server management panels may lag behind the official PHP release cycle, leaving systems vulnerable even after the community is aware of the fix.
In practical scenarios, administrators have reported finding that their systems were already several security releases behind before the emergency "php2shell" fix was even announced. The process of updating can be extensive, often involving dozens or hundreds of packages across multiple PHP versions. In environments where immediate updates are not possible due to repository delays, the recommended mitigations—such as disabling session upload progress—become the primary line of defense.
As the security community continues to digest the details of these vulnerabilities, the focus remains on rapid patching. Docker users are encouraged to pull the latest official images, while those on shared hosting should contact their providers to confirm that the necessary updates have been applied. The vulnerabilities were reported by a collaborative group of researchers including lcfr-hax, sagitzadik-wiz, tomash-areion, and amyb-oai, with the critical fixes developed by the core PHP team. For now, the message to the web remains clear: update immediately to secure the foundation of the modern web.
