[CVE-2026-123007] Unauthenticated RCE via Integer Underflow in NGINX's HTTP/2 Flow Control
At a glance Item Details CVE CVE-2026-123007 (aka "NGINX2Shell," one of the "NGINX2Root" bundle of disclosures) CWE Integer underflow leading to out-of-bounds heap read/write CVSS 4.0 9.2 (Critical) per Wiz
At a glance
| Item | Details |
|---|---|
| CVE | CVE-2026-123007 (aka "NGINX2Shell," one of the "NGINX2Root" bundle of disclosures) |
| CWE | Integer underflow leading to out-of-bounds heap read/write |
| CVSS 4.0 | 9.2 (Critical) per Wiz/F5 — nginx.org classifies it as "major" |
| Affected component | NGINX Open Source ngx_http_v2_module (HTTP/2) |
| Affected versions | NGINX OSS 1.9.5–1.31.8 (present for over a decade, since 2015) / NGINX Plus R33, 37.0.0 |
| Fixed versions | NGINX OSS 1.30.7 (stable) / 1.31.9 (mainline), NGINX Plus 37.0.8.1 / 37.3.0.1 |
| Discovery | Wiz Research, Ikotas Labs, Metnir, Rapid7 (Stephen Fewer), and Xint — five teams, independently |
| Disclosed | 2026-11-18 (coordinated F5 release; Wiz's final report to F5 on 11/16) |
| Public PoC |
sfewer-r7/CVE-2026-123007 (Rapid7) — reproduces RCE against 1.31.8 over HTTP/2+TLS in roughly 2.5 minutes, needs about 128 GB of traffic |
In NGINX's HTTP/2 flow-control logic, refunding unsent data credit for a canceled stream skips a bounds check, letting a counter exceed its protocol maximum. A chain of signed/unsigned integer conversions that all trust that counter then collapses into an out-of-bounds heap memory copy. It triggers unauthenticated, on any NGINX with HTTP/2 enabled — no backend application or third-party module required — even a server doing nothing but serving static files.
1. Background — HTTP/2 flow control and its credit system
HTTP/2 multiplexes multiple requests (streams) over a single connection. If one stream pushes response data too fast or in too large a volume, the client can't keep up and its buffers back up. HTTP/2 solves this with a credit system called flow control.
- The client grants the server a credit (a window) representing how much it's ready to receive.
- NGINX tracks the connection's remaining credit in a counter:
h2c->send_window. - Queuing response data subtracts that data's size from the counter.
- Receiving a
WINDOW_UPDATEframe from the client increases it.
This counter has a protocol-defined ceiling — NGX_HTTP_V2_MAX_WINDOW. Under normal operation, it should never be able to exceed that ceiling.
2. Root cause — an unchecked refund, and a sign that flips
Walking through the three-stage chain Wiz Research's technical writeup laid out:
2.1 Refunding credit for data that was never sent
What happens if a stream is canceled while its response data is still sitting in the queue — meaning send_window has already been debited for it? ngx_http_v2_filter_cleanup() clears out that unsent data and refunds the unused credit.
/* ngx_http_v2_filter_cleanup() — refund for unsent data */
h2c->send_window += window;
This refund never checks whether the result exceeds NGX_HTTP_V2_MAX_WINDOW. If the client already increased the window via WINDOW_UPDATE while that data sat queued, adding the refund on top can push the counter past the protocol's own ceiling. h2c->send_window now holds a value the rest of the HTTP/2 code assumes can never occur.
2.2 A bounds check that no longer does anything
The next problem lives in ngx_http_v2_state_window_update(), which handles incoming WINDOW_UPDATE frames from the client.
/* checking whether a window increase would exceed the limit */
if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window)
This check computes remaining headroom as "ceiling minus current counter." But if send_window has already blown past the ceiling, that subtraction is unsigned arithmetic — it can't represent a negative number, so it wraps around into a huge positive value instead. The check now has no way of noticing the counter is already broken; it reads the wrapped value as "plenty of headroom left" and happily approves further increases.
2.3 From a flipped sign to a memory copy
This corrupted counter eventually reaches ngx_http_v2_send_chain(), where it's cast to the signed type off_t to compute how much data to send. A sufficiently large value becomes negative in that conversion, and that negative length gets handed to a structure describing a slice of the response buffer — producing a buffer whose end pointer sits before its start pointer.
When this malformed buffer reaches the TLS send path, ngx_ssl_send_chain(), another round of signed/unsigned conversion turns the invalid length into an out-of-bounds heap memory copy. An attacker can use this to leak memory (defeating ASLR) and corrupt the heap, arriving at unauthenticated remote code execution.
Wiz Research confirmed RCE with an ASLR bypass on official NGINX 1.31.7 and 1.31.8 builds, over HTTP/2+TLS, on 64-bit systems, serving response data straight from memory. Worth underlining: this path is reachable with no backend application and no third-party module at all — ordinary NGINX serving static files is enough.
3. Trigger conditions — what an attacker actually has to send
The core trigger is: cancel a stream, but first make sure the client has inflated the window enough.
| Condition | Detail |
|---|---|
| HTTP/2 enabled |
http2 on or listen ... http2; — without it, this CVE is moot |
| Transport | Wiz confirmed RCE over HTTPS (TLS) on 64-bit systems; whether plaintext h2c is equally viable isn't documented publicly |
| Attack pattern | Trigger a large response → cancel the stream while the response sits queued → meanwhile send a flood of WINDOW_UPDATE frames to push the window to an arbitrary value |
| Backend requirement | None — reachable from plain static file serving (contrast with CVE-2026-123633, which needs a reverse-proxy setup) |
Rapid7's Stephen Fewer published a working PoC (sfewer-r7/CVE-2026-123007) that quantifies exactly how hard this is in practice:
- Succeeded against an NGINX 1.31.8 container with HTTP/2 + TLS enabled
- Required roughly 128 GB of HTTP/2 traffic — mostly control frames like
WINDOW_UPDATE, not actual data - Completed in roughly 2.5 minutes (with the caveat that this varies by environment)
- Depends on an x86-64-specific glibc memory-copy routine — sensitive to architecture and libc combination
- Needs ASLR bypass by recovering heap addresses from server responses — the typical difficulty profile of a memory-safety bug
Rapid7's team went a step further, demonstrating that this HTTP/2 bug chains with a separate Linux kernel SCTP networking flaw to reach root on the host — not stopping at the NGINX worker's privileges, but escaping the container/host entirely.
Real-world constraints that make this harder to pull off:
- A CDN or WAF that terminates HTTP/2 in front of NGINX may not forward the attacker's crafted payload through intact (implementation-dependent).
- A slow connection might not deliver all 128 GB before NGINX's default one-hour connection limit cuts it off.
- From a detection standpoint, the traffic pattern stands out: an unusually long-lived HTTP/2 connection carrying a large volume of
WINDOW_UPDATEframes and heavy traffic is a clear signal.
4. Why five teams found this at the same time
One detail stands out: this exact code has existed since NGINX 1.9.5 in 2015. A bug nobody caught for over a decade was independently found by five different research teams at almost the same moment — Wiz Research, Ikotas Labs, Metnir, Rapid7, and Xint.
Wiz Research attributes this convergence to the advance of AI-assisted vulnerability research tooling (their own platform, "Wiz Atlas," plus the AI models they used to validate the finding's impact). Memory-safety bugs have traditionally required "tracing subtle interactions between memory operations and multiple code paths" to find — and that complexity itself has acted as a practical barrier for years. Wiz's own assessment: "complexity can no longer be relied upon as a barrier to discovery or exploitation."
The public disclosure timeline to F5 bears this out:
- 10/21: Wiz reports an HTTP/2 use-after-free (a separate CVE, 2026-123633) to F5 — F5 confirms another team had already reported the same bug
- 11/10: F5 supplies a patch for 123633 for review
- 11/16: Wiz reports a second HTTP/2 vulnerability (later assigned CVE-2026-123007) to F5
- 11/17: F5 confirms this matches an existing report and assigns it CVE-2026-123007, slating it for the 11/18 release
- 11/18: F5's coordinated security release and public disclosure
Five unrelated teams bringing in the same bug within days of each other is itself being read as a signal that the landscape of vulnerability research difficulty is shifting.
5. Scope of exposure
According to Xint's Shodan-based scan, 98.9% of 11.94 million version-identifiable NGINX hosts were running an affected release. That figure counts versions only — it doesn't confirm whether HTTP/2 is actually enabled or whether a fix has already landed. Still, given that NGINX powers roughly 30% of the web server market, the base population here is enormous regardless.
Of the ten "NGINX2Root" vulnerabilities disclosed together, five are rated Critical with RCE potential:
| CVE | Description | Condition |
|---|---|---|
| CVE-2026-123007 | HTTP/2 flow-control memory corruption | Reachable in a default config, HTTP/2 enabled alone |
| CVE-2026-123633 | HTTP/2 connection use-after-free | Only when HTTP/2 is configured as a reverse proxy |
| CVE-2026-121810 | HTTP/3 use-after-free | Only when HTTP/3 is configured as a reverse proxy |
| CVE-2026-123634 | Use-after-free in DNS resolver response handling | Only with resolver + request-derived proxy_pass + mirror together |
| CVE-2026-113425 | Use-after-free in the mail proxy module | Only when configured as a mail server proxy using auth_http
|
CVE-2026-123007 has by far the broadest blast radius here precisely because it needs no special proxy, mail, or DNS configuration — just "HTTP/2 turned on" in an otherwise default setup.
6. Patching and remediation
Immediate steps
# 1) Check installed version and HTTP/2 status across every host/container image
nginx -v
nginx -T 2>/dev/null | grep -nE 'http2|listen'
- Upgrade NGINX OSS to 1.30.7 (stable) or 1.31.9 (mainline)
- Upgrade NGINX Plus to 37.0.8.1 or 37.3.0.1
-
Restart after patching — don't rely on reload alone.
nginx -s reloadonly re-reads configuration; it doesn't replace the running binary. A worker process still running the old version stays vulnerable - Run
nginx -t && nginx -s reload, then confirm the old worker processes have actually exited
Interim mitigation if patching isn't immediately possible
# nginx.conf — apply to every affected server block
http2 off;
- On NGINX 1.25.1+, use the
http2 off;directive - On earlier versions, remove the
http2parameter from everylistendirective - Test application compatibility (anything relying on HTTP/2) before reloading, and confirm old workers exit
- Safe to re-enable HTTP/2 once the patch is applied
Special attention for containerized/orchestrated environments
-
ingress-nginx(the community Kubernetes Ingress) has had its project archived — no fix is coming. Disable it withuse-http2: "false"or migrate to another ingress controller - F5 NGINX Ingress Controller: versions before 5.8.0 are affected → upgrade to 5.8.0+
- NGINX Gateway Fabric: versions before 2.9.0 are affected (HTTP/2 on by default) → upgrade to 2.9.0+
Detection signals
- An unusually long-lived HTTP/2 connection combined with a large volume of
WINDOW_UPDATEframes and heavy traffic - Unexpected NGINX worker process crashes (segfaults) — not a confirmed indicator on its own, but worth investigating
- Unexpected shells or command execution originating from an NGINX worker process
How to prioritize
Patch internet-facing NGINX instances with HTTP/2 enabled and no HTTP/2-terminating CDN or WAF in front of them first. The real-world constraints — 128 GB of traffic, x86-64/glibc dependency — are not grounds for complacency: Rapid7 has already demonstrated reproduction in about 2.5 minutes, and Xint's scan shows the unpatched population runs into the tens of millions.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.
