Critical Nginx Vulnerability CVE-2026-42533 Allows Remote Code Execution and Denial of Service

F5 has issued critical security patches for a significant vulnerability within the widely used Nginx web server, identified as CVE-2026-42533. This flaw, if exploited, could permit a remote and unauthenticated attacker to trigger a heap buffer overflow within the Nginx worker process. While the immediate consequence is often a denial of service (DoS) by crashing or restarting the worker, F5’s analysis indicates that under specific circumstances, particularly when Address Space Layout Randomization (ASLR) is disabled or can be bypassed, the vulnerability may escalate to allow for remote code execution (RCE). The patches were released on July 15th, addressing the issue in Nginx versions 1.30.4 (stable branch) and 1.31.3 (mainline branch), as well as NGINX Plus version 37.0.3.1. Users running earlier builds are strongly advised to upgrade immediately to mitigate the risk.
The vulnerability resides within Nginx’s script engine, a component responsible for dynamically assembling strings from various directives during the processing of incoming requests. Its exploitation is contingent upon a precise configuration: the presence of a regular expression (regex)-based map directive whose output variable is subsequently referenced within a string expression, and critically, this reference occurs after a capture from an earlier regex match in the request processing pipeline. This specific interplay disrupts the script engine’s intended two-pass evaluation mechanism.
Technical Deep Dive into the Vulnerability
Nginx’s script engine operates in two primary passes when constructing dynamic strings. The first pass is designed to precisely calculate the required buffer size for the resulting string. Based on this measurement, a buffer of the calculated size is allocated. The second pass then proceeds to populate this allocated buffer with the actual string content. The core of the vulnerability lies in the fact that both these passes read from and write to the same shared capture state.
However, when the specific vulnerable configuration is present, the evaluation of the map directive’s regex occurs between these two passes. This intermediate evaluation effectively overwrites the capture state that was originally read by the first pass. Consequently, the measurement pass sizes the buffer based on the initial, legitimate capture (e.g., a $1 variable captured from a location match). In stark contrast, the second, writing pass attempts to fill this buffer with data derived from a different, and potentially attacker-controlled, larger source. Because the allocated buffer is now too small to accommodate the data from the attacker-controlled source, a heap buffer overflow occurs. The length and content of this overflow are directly dictated by the malicious crafted HTTP request.

F5 has assigned CVE-2026-42533 a CVSS v4 score of 9.2 and a CVSS v3.1 score of 8.1, reflecting its high severity. While the attack complexity is rated as high, the potential impact is substantial. The vulnerability affects a broad range of Nginx versions, specifically all versions from 0.9.6 through 1.31.2, a span that extends back to 2011, the year Nginx introduced regex support for its map directive. This wide version range underscores the extensive potential exposure across the Nginx ecosystem.
Affected Products and Configuration Dependencies
It is crucial to understand that not all Nginx installations are vulnerable. The exposure is highly dependent on the specific configuration rather than solely on the Nginx version. F5’s official advisory details that the flaw impacts not only the core Nginx server and NGINX Plus but also other products within their ecosystem, including NGINX Ingress Controller, Gateway Fabric, App Protect WAF, and Instance Manager. However, at the time of the initial advisory, F5 had not yet released patched builds for these four specific downstream products, creating a potential gap in immediate security for users relying on them.
The narrow configuration required for exploitation involves a regex-based map directive. The output variable from this map must then be referenced within a string expression. Crucially, this reference must occur after a capture group from an earlier regex match (like $1, $2, etc.) in the request processing. Furthermore, the order of operations is critical: the capture must be written to the shared state before the map variable is evaluated in the string expression.
Timeline and Discovery of the Vulnerability
The discovery of CVE-2026-42533 is a testament to the collaborative efforts of the cybersecurity community. F5 reported that the vulnerability was independently reported by over a dozen security researchers, highlighting the diligence of individuals in identifying and reporting such critical flaws. The vendor expressed gratitude to these researchers for bringing the issue to their attention.
The official changelog for Nginx credits the fix to Mufeed VH of Winfunc Research and to Maxim Dounin, a maintainer of the Nginx project. This collaborative approach in addressing security vulnerabilities is a common and effective practice within the open-source community.

One of the researchers who independently discovered and reported the vulnerability is Stan Shaw, who operates under the online moniker "cyberstan." Shaw has published a detailed write-up on his findings, offering a deeper technical analysis that goes beyond F5’s official advisory. His research provides critical insights into the potential impact and exploitation vectors of CVE-2026-42533.
Amplifying the Threat: Remote Code Execution Potential
While F5’s advisory initially categorized the vulnerability primarily as a denial-of-service risk, Stan Shaw’s analysis suggests a more severe outcome. F5 conditioned code execution on the disabling or bypassability of ASLR. However, Shaw argues that the vulnerability itself can provide the means to bypass ASLR. He explained to The Hacker News that the capture state overwriting mechanism can function in reverse. When the data written by the attacker is smaller than the original capture, the oversized buffer can inadvertently leak uninitialized heap data.
Shaw’s testing on a default Ubuntu 24.04 build demonstrated that a single, unauthenticated GET request could be used to recover memory addresses necessary for crafting an exploit payload. This capability significantly lowers the barrier to entry for attackers, potentially transforming a DoS vulnerability into a full-blown remote code execution threat on default system configurations.
"A reader of the F5 advisory could reasonably conclude this is DoS-only on default systems. It is not," Shaw stated emphatically. He claims his exploitation method was successful in 10 out of 10 tests. Due to the sensitive nature of his findings, Shaw has opted to withhold the detailed exploitation techniques and proof-of-concept (PoC) code for now, preventing independent verification until a later date.
Mitigation Strategies and the Importance of Upgrading
For organizations unable to immediately apply the latest patches, F5 has proposed a temporary mitigation strategy. This involves reconfiguring affected regex maps to utilize named captures instead of direct regex captures. According to Shaw, this measure effectively closes the primary exploitation path and should mitigate the risk for the majority of vulnerable configurations.

However, Shaw also identified a potential residual risk even with this mitigation. He detailed a scenario where a map directive defines the same named group as the location regex. In such cases, the vulnerability can still be triggered through a secondary code path, leading to the same overflow. This specific scenario was confirmed by Shaw using AddressSanitizer and is not explicitly mentioned in F5’s official advisory, underscoring the complexity and nuance of the vulnerability.
"Upgrading to 1.30.4 / 1.31.3 is the only complete fix," Shaw reiterated, emphasizing that the patches provided by F5 are the most robust solution.
To assist administrators in identifying potentially vulnerable configurations within their Nginx setups, Stan Shaw has developed an automated scanner. This tool is designed to parse Nginx configuration files, including those included via include directives, and flag only the specific ordering of directives that creates the exploitable scenario. It is important to note that Shaw’s scanner is a diagnostic tool and does not perform any exploitation.
A Pattern of Vulnerabilities in Nginx’s Script Engine
CVE-2026-42533 is not an isolated incident. It represents the third heap overflow vulnerability discovered in Nginx’s expression-evaluation code within approximately two months. Prior to this, the Rift vulnerability (CVE-2026-42945) was disclosed in May, and an overlapping captures bug in the rewrite module (CVE-2026-9256) was reported just days later.
All three vulnerabilities share a common underlying weakness: the two-pass design of Nginx’s script engine. In each instance, the engine measures a buffer size in one pass and then writes into that buffer in a subsequent pass. The overflow occurs when the data written in the second pass exceeds the size determined in the first. The specific trigger mechanism differs in each case: a stale flag in Rift, overlapping captures in the rewrite module bug, and the clobbered capture state in CVE-2026-42533. The shared vulnerability, as researchers point out, is the engine’s inherent trust in its own measurement process, which can be manipulated under specific conditions.

Broader Implications and Future Risks
As of July 20th, CVE-2026-42533 had not yet been added to CISA’s Known Exploited Vulnerabilities (KEV) catalog, and no public exploit code had surfaced. However, the history of similar vulnerabilities suggests that this situation may not persist. Stan Shaw plans to release his proof-of-concept exploit code 21 days after the release of the patch. The precedent set by the Rift vulnerability, where exploit code became public within days and active exploitation followed shortly after, serves as a stark warning. The rapid weaponization of such flaws necessitates proactive patching and diligent security practices.
The Hacker News reached out to F5 for clarification regarding the efficacy of the named captures mitigation in light of Shaw’s findings and for an update on the release schedule for patched builds of the affected downstream products. As of the publication of this article, F5 had not yet provided a response.
The ongoing discovery of these critical vulnerabilities in Nginx’s core functionality underscores the importance of continuous security auditing and prompt patching. While Nginx remains a cornerstone of the web infrastructure, its complex internal mechanisms, particularly the script engine, require constant vigilance from both developers and security researchers to ensure its integrity and the security of the countless websites and applications it serves. The interconnectedness of the digital landscape means that a single vulnerability in a widely adopted technology like Nginx can have far-reaching consequences, making timely and comprehensive security responses paramount.






