DEV Community

Cover image for Unauthenticated Remote Code Execution in NGINX: HTTP/2 Flaw Lurked for 11 Years
Joho no Todai
Joho no Todai

Posted on Originally published at joho-todai.com AI-assisted

Unauthenticated Remote Code Execution in NGINX: HTTP/2 Flaw Lurked for 11 Years

Two memory-safety vulnerabilities have been found in NGINX's HTTP/2 processing that could allow unauthenticated remote code execution. One had existed since version 1.9.5 in 2015, and fixes are available in open-source versions 1.31.9 and 1.30.7.

Key points

  • What happened: Two NGINX HTTP/2 vulnerabilities were disclosed: CVE-2026-123007, an integer underflow present since 2015, and CVE-2026-123633, a use-after-free. Fixed versions 1.31.9 and 1.30.7 have been released
  • Why it matters: Both are memory-safety flaws that could lead to unauthenticated remote code execution in NGINX installations with HTTP/2 enabled. Five independent research teams discovered them using AI
  • Conditions for the demonstration: Rapid7 demonstrated RCE, but its method depends on transferring about 128 GB over HTTP/2 and on specific CPU features. This does not guarantee that no other attack method exists
  • How to protect systems: Updating to a fixed release is the primary remedy. Temporarily disabling HTTP/2 can mitigate these two flaws when immediate updating is impossible, but it does not address separate CVEs involving HTTP/3 or the mail proxy

Ten fixes, two HTTP/2 flaws, and conflicting severity ratings

Ten vulnerabilities dated November 18 were added to the F5-managed NGINX security advisory list. The corresponding fixed open-source releases are mainline 1.31.9 in the development branch and stable 1.30.7.

The most serious of the ten are two memory-corruption flaws in HTTP/2 processing, CVE-2026-123007 and CVE-2026-123633. Both could lead to unauthenticated remote code execution. A common prerequisite is that HTTP/2 is enabled on the target server.

CVE-2026-123007 is an integer underflow in HTTP/2 flow control. The nginx.org list says versions 1.9.5 through 1.31.8 are affected, meaning the flaw remained in the code for 11 years, beginning in 2015. nginx.org classifies its severity as "major."

CVE-2026-123633 is a use-after-free in HTTP/2 connection processing. Versions 1.19.7 through 1.31.8 are affected. Its prerequisites include a shortage of available connection slots in a reverse-proxy configuration. nginx.org rates it "medium."

The discrepancy in the ratings requires attention. nginx.org separates the flaws into major and medium, while security company Wiz rates both Critical at 9.2 under CVSS v4.0. nginx.org's proprietary classification and CVSS use different scales, so relying on either alone can misrepresent the actual risk. Configuration prerequisites and confirmed impact must be considered together. The same discrepancy appeared in the previous NGINX security update (in Japanese).

The ten vulnerabilities also include an HTTP/3 use-after-free, CVE-2026-121810; a mail-proxy use-after-free, CVE-2026-113425; and a resolver use-after-free, CVE-2026-123634. Wiz also rates all three at 9.2 under CVSS v4.0.

Figure omitted — see the original article

Why the integer underflow occurs

The mechanism behind CVE-2026-123007 warrants a closer look.

HTTP/2 handles multiple requests, or streams, simultaneously over a single connection. Flow control limits how much response data a server can send, with separate counters for each stream and for the connection as a whole. NGINX deducts reserved capacity from the connection counter when it places data in the send queue.

According to Rapid7's analysis, an attacker first stops reading responses, leaving outgoing data queued, while raising the connection counter to its maximum. The attacker then forcibly closes a stream, causing the reservation for the unsent queued data to be returned to the counter. Because the counter was already at its maximum, the returned amount pushes it over the limit.

Under the HTTP/2 specification, the connection counter has a maximum of 2^31 minus 1, or about 2.1 billion, and must not exceed it. NGINX's reservation-return process did not check this limit.

When the server then receives another WINDOW_UPDATE frame granting additional send capacity, the subtraction used to calculate the remaining headroom causes an unsigned-integer underflow. The check is effectively disabled, allowing the counter to be increased further. Eventually, the abnormal value is interpreted as the length of response data, causing an out-of-bounds memory copy during TLS transmission.

Where the use-after-free occurs

CVE-2026-123633 has somewhat different trigger conditions.

According to Wiz's analysis, NGINX places an HTTP/2 connection on a "reusable connections" list while it has no active request. The flaw is that NGINX fails to remove the connection from the list when a new request is created. To NGINX, a connection that is actively processing a request continues to appear safe to close.

If available connection slots run out when NGINX tries to open an upstream connection in this state, it selects a connection from the reusable list and attempts to close it. If it selects the active connection, request processing continues to reference the memory after it has been freed.

Demonstrated successfully, but with demanding conditions

Rapid7 demonstrated unauthenticated remote code execution using CVE-2026-123007 in a 64-bit Linux Docker environment running NGINX 1.31.8 and released proof-of-concept code on GitHub.

The method has major constraints. It requires transferring about 128 GB of data over HTTP/2, taking roughly two minutes on a 10 Gbps-class network and about 17 minutes at 1 Gbps. NGINX's default connection lifetime is one hour, so the technique times out below roughly 300 Mbps. The demonstrated attack path also depends on the glibc memory-copy implementation associated with x86-64 CPU features avx512f and avx512vl.

These are only the conditions for the method Rapid7 published and do not rule out other attack methods. Rapid7 itself noted that alternative exploitation strategies may be viable. Wiz withheld its PoC but said it confirmed remote code execution against common NGINX configurations in multiple lab environments.

In a response F5 provided to The Register, the company said there was no evidence of exploitation in real-world environments at the time of disclosure.

In configurations where a CDN or WAF terminates HTTP/2, an attacker's precisely constructed frames may not reach the back-end NGINX server unchanged. Wiz cautions, however, that this depends on the implementation.

Five teams found the flaws independently, with AI as the common factor

Five teams—Wiz Research, Ikotas Labs, Metnir, Rapid7, and Xint—independently discovered and reported the two flaws to F5. Wiz says it found the vulnerabilities using its Wiz Atlas AI code-scanning platform and assessed their impact with Gemini 4 Carbon and ChatGPT 5.6 Sol.

According to The Register, Xint also found three additional NGINX vulnerabilities and showed that chaining them with a Linux kernel vulnerability could yield root access on the host, naming the set nginx2root.

The trend of AI uncovering vulnerabilities across infrastructure software follows the Apache HTTP Server HTTP/2 vulnerability (in Japanese) and HTTP/2 Bomb (in Japanese). The fact that several independent teams found a flaw that had remained in the code for 11 years at nearly the same time suggests that AI is changing the economics of vulnerability research.

Updating to fixed versions and other mitigations

The primary response is to update to a fixed release. For open-source NGINX, those releases are mainline 1.31.9 and stable 1.30.7. For NGINX Plus, the fixed releases are 37.0.8.1 and 37.3.0.1 for CVE-2026-123007, and 37.0.7.1 and 37.2.0.1 for CVE-2026-123633. After updating, administrators must ensure that the fixed binary has been loaded and that old worker processes have exited.

On systems installed from a Linux distribution, the distributor may have backported the security fixes. Administrators should check the distributor's security information rather than relying only on the displayed NGINX version. Products embedding NGINX, including OpenResty and Kubernetes Ingress Controller, must also be checked individually for vendor responses.

Systems that cannot be updated immediately can mitigate the two HTTP/2 flaws by disabling HTTP/2 with the http2 off; setting or by removing the http2 parameter from the listen directive. The ten fixes also cover issues involving HTTP/3 and the mail proxy, however, so disabling HTTP/2 alone does not resolve all of them. The prerequisites for each CVE must be checked separately.

In Japan, TechMatrix provides NGINX Plus for uses including reverse proxies and authentication proxies. The distribution of deployed versions and HTTP/2 configurations in Japan could not be confirmed, but organizations operating internet-facing NGINX servers urgently need to compare their own versions and configurations with the affected conditions. "nginx vulnerability" has also appeared among Google's trending searches in Japan. Many administrators have already begun responding.


Originally published on Joho no Todai. The Japanese original is here.

Top comments (0)