Automated Threat Modeling

NGINX HTTP/2 CVE-2026-123007: A Flow Control Window Overflow That Leads to Memory Corruption and RCE

CVE-2026-123007 is an HTTP/2 flow control accounting flaw in NGINX that can corrupt worker memory and, under specific conditions, reach unauthenticated RCE. This covers the PoC, the patch, and detection.

CVE Analysis

13 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-18

NGINX HTTP/2 CVE-2026-123007: A Flow Control Window Overflow That Leads to Memory Corruption and RCE

Introduction

A subtle accounting mistake in how NGINX tracks HTTP/2 flow control credit for queued DATA frames lets a remote client drive the connection send window past the protocol maximum, and from there into an integer underflow that corrupts worker memory. Rapid7's Stephen Fewer, who discovered the flaw, published a verified proof of concept that achieves unauthenticated remote code execution against a stock nginx 1.31.8 container. That puts one of the internet's most widely deployed web servers in scope for memory corruption over a single TLS connection.

NGINX is a web server, reverse proxy, load balancer, content cache, and API gateway. W3Techs reported it was used by 29.8 percent of websites with a known web server on a page dated November 16, 2026. That reach is what makes a data plane HTTP/2 bug like this one worth understanding in detail.

Technical Information

The vulnerability lives in ngx_http_v2_module and is reachable on any affected NGINX version configured to use HTTP/2 on a TLS listener. F5 describes the mechanism as a flow control window that can exceed its allowed threshold, producing a heap buffer overflow usually followed by a worker segmentation fault. Rapid7 characterizes the underlying flaw as an integer underflow in HTTP/2 flow control that yields an invalid length during a later memory copy. It is classified as CWE-191 (integer underflow) and CWE-787 (out of bounds write).

Root cause

Before the fix, NGINX subtracted a DATA frame's size from h2c->send_window as soon as it queued the frame, not when the frame actually went out on the wire. The client never observes that internal reservation, so from its point of view the bytes were never spent. It can therefore legally send a WINDOW_UPDATE to top the window back up to the HTTP/2 maximum of 2^31-1. If the stream is then cancelled, the cleanup handler refunds the reservation a second time, and the window climbs above the protocol maximum.

The connection level WINDOW_UPDATE check is where the damage compounds. The validation computed the allowed increment as NGX_HTTP_V2_MAX_WINDOW - h2c->send_window. Once send_window exceeds MAX, that subtraction underflows as an unsigned value, and the check stops rejecting anything. Roughly 2^33 legal increments can then drive the counter into the top half of the 64-bit range.

The oversized unsigned window is later cast to a signed off_t output limit, producing a negative length. ngx_http_v2_filter_get_shadow builds an inverted buffer, with last positioned before pos, and ngx_ssl_send_chain passes a huge size_t to ngx_memcpy. The result is an out of bounds read and write in the TLS send path.

Attack flow

The exploitation chain, as documented in the PoC docstring and Rapid7's analysis, proceeds as follows:

  1. The client induces transport backpressure to keep DATA frames queued, raising the connection send window to the HTTP/2 maximum (2^31-1) and streaming just below it.
  2. A SETTINGS_INITIAL_WINDOW_SIZE increase forces affected streams to exceed MAX. NGINX terminates those streams via ngx_http_v2_terminate_stream but leaves the connection usable, and request cleanup in ngx_http_v2_filter_cleanup restores the reserved credit without re-checking the MAX invariant, pushing h2c->send_window above MAX.
  3. The next connection WINDOW_UPDATE triggers the unsigned underflow in the MAX - send_window bounds check, letting roughly 2^33 legal increments drive the counter into the top half of the 64-bit range.
  4. The oversized unsigned window is cast to a signed off_t output limit, producing a negative length that leads to an inverted buffer and an out of bounds ngx_memcpy.
  5. The exploit leaks heap, nginx, and libc addresses to defeat ASLR, reclaims the overwritten request pool on the same worker, resolves system() from disclosed glibc ELF metadata, and redirects a request pool cleanup callback to invoke an attacker chosen command.

There is no control plane exposure; this is strictly a data plane issue. F5 does not state whether authentication is required, so the unauthenticated characterization is attributed to Rapid7.

Proof of Concept

A complete, verified public proof of concept exists. Stephen Fewer of Rapid7, who discovered the vulnerability, published it in the GitHub repository sfewer-r7/CVE-2026-123007 (public, created 2026-11-18, default branch main). Rapid7's technical disclosure blog accompanies it and independently documents the same PoC and its constraints.

The repository contains two distinct artifacts plus a full reproduction recipe:

  • simple-trigger-poc.py, a minimal crash trigger (approximately 17 KB) that first demonstrates the flow control accounting error and then sends enough traffic to crash an nginx worker with SIGSEGV. Per the reproduction doc, the complete trigger transmits about 60 GiB of application traffic and requires 64-bit CPython 3.10 linked against OpenSSL 3.
  • exploit/, a full, componentized unauthenticated RCE exploit. The entry point exploit/exploit.py is a thin launcher that calls nginx_rce.cli:main. The nginx_rce package contains the staged implementation (bootstrap.py, bulk.py, protocol.py, memory.py, reclaim.py, runner.py, target.py, profiles.py, constants.py), a native streamer.c helper (reports nginx-rce-streamer/2) that emits the approximately 119 GiB plaintext schedule efficiently, pre-built target profiles (golden-nginx-1.31.8-debian13-amd64.json, golden-nginx-1.31.6-debian13-amd64.json), a profile tool, and a tests/ suite with 35 component tests.

Verified target and outcome

The PoC achieves unauthenticated RCE against a linux/amd64 Docker image of nginx 1.31.8 (nginx@sha256:5ab5b0b01097420873a3f3330f44248e34a3c2a3e8d5ee30658aeae8cb7435da) configured with listen 443 ssl; and http2 on;. A demonstration video is included. Rapid7 rates it CVSS v4.0 9.2 (Critical), CWE-191.

Documented usage from NGINX_HTTP2_STANDALONE_REPRODUCTION.md:

exploit/.venv/bin/python exploit/exploit.py --target https://127.0.0.1:19443/ \ --profile golden-nginx-1.31.8-debian13-amd64 \ --cmd 'touch /tmp/rapid7-nginx-h2-proof-01'

Success is confirmed independently by the marker file appearing in the container owned by UID/GID 101, the nginx worker's permissions. The CLI exposes --target, --cmd, --profile (accepts auto, a built-in name, or a JSON path), and --verbose.

Practical constraints and reliability

The PoC is only reliable against a freshly started, single-client target with a clean heap. It requires transmitting a very large volume of traffic, about 119.02 GiB of plaintext for the RCE path plus TLS and network overhead, reflecting the roughly 2^33 WINDOW_UPDATE amplification, and it uses 16 auxiliary connections for heap grooming. Because of nginx's default one-hour connection lifetime, links slower than about 300 Mbit/s cannot finish in time; Rapid7 cites about 2 minutes at 10 Gbit/s and about 17 minutes at 1 Gbit/s. The RCE strategy depends on glibc selecting its EVEX/YMM (AVX512) memcpy fast path, so the target host must expose the avx512f and avx512vl CPU features. Proxying or TLS termination, or a messy heap, will likely defeat it, and no alternative RCE strategy is currently known. Rapid7 validated clean-start RCE runs (approximately 190 to 233 seconds) and worker SIGSEGV crashes on 2026-11-06. No in the wild exploitation was reported as of disclosure.

Patch Information

F5 and nginx fixed CVE-2026-123007 in nginx 1.31.9 (mainline) and nginx 1.30.7 (stable), both released on 18 November 2026. The nginx changelog describes the bug as "a flow control window overflow in HTTP/2" that could crash a worker process "or might have potential other impact", and credits Xint.io. The nginx security advisories page rates it major, listing 1.9.5 through 1.31.8 as vulnerable and 1.31.9+ / 1.30.7+ as not vulnerable.

The fix is commit b89c4100bf67 in nginx/nginx, titled "HTTP/2: account for queued frames when validating WINDOW_UPDATE". Roman Arutyunyan wrote it on 2026-10-29 and Sergey Kandaurov committed it on 2026-11-11. It is small: 6 lines added and 2 removed across ngx_http_v2.h, ngx_http_v2.c, and ngx_http_v2_filter_module.c.

Why the old accounting was wrong

nginx subtracted a DATA frame's size from h2c->send_window as soon as it queued the frame, not when the frame went out on the wire. The client never sees that internal reservation, so from its side the bytes were never spent. It could legally send a WINDOW_UPDATE to top the window back to 2^31-1. If the stream was then cancelled, the cleanup handler refunded the reservation a second time, and the window went above the protocol maximum. The WINDOW_UPDATE check, NGX_HTTP_V2_MAX_WINDOW - h2c->send_window, then underflowed as an unsigned value and stopped rejecting anything.

What the patch changes

A new counter tracks credit that is reserved but not yet sent, in src/http/v2/ngx_http_v2.h:

size_t send_window; + size_t send_queued; size_t recv_window;

The counter is updated everywhere the reservation changes, in src/http/v2/ngx_http_v2_filter_module.c:

@@ ngx_http_v2_send_chain() h2c->send_window -= frame_size; + h2c->send_queued += frame_size; @@ ngx_http_v2_data_frame_handler() h2c->payload_bytes += frame->length; + h2c->send_queued -= frame->length; @@ ngx_http_v2_filter_cleanup() h2c->send_window += window; + h2c->send_queued -= window;

Queueing a frame moves credit from send_window into send_queued, so the sum is unchanged. Actually sending the frame in ngx_http_v2_data_frame_handler removes it from send_queued; the client has now consumed that credit, so the sum correctly drops. Cancelling a queued frame in ngx_http_v2_filter_cleanup moves the credit back from send_queued to send_window, again leaving the sum unchanged.

Finally, WINDOW_UPDATE validation uses the window as the client sees it, in src/http/v2/ngx_http_v2.c:

- if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) { + if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window - h2c->send_queued) { ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0, "client violated connection flow control: " "received WINDOW_UPDATE frame " "with window increment %uz " "not allowed for window %uz", - window, h2c->send_window); + window, h2c->send_window + h2c->send_queued); return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_FLOW_CTRL_ERROR);

Why this closes the bug

The patch enforces one invariant: send_window + send_queued, the client's view of the window, can never exceed NGX_HTTP_V2_MAX_WINDOW. Queueing and refunding leave that sum unchanged, sending only lowers it, and the only thing that raises it, a client WINDOW_UPDATE, is now checked against it. Since send_queued is never negative, send_window alone can never exceed MAX either, so the subtraction in the check cannot underflow and the oversized 64-bit credit can no longer be built.

Applied to Rapid7's attack with 1,393 bytes of queued DATA, a vulnerable build tops the window to MAX (2,147,483,647), then refunds 1,393 bytes on stream cancellation, leaving 2,147,485,040, which is above MAX. On a patched build, send_window is MAX minus 1,393 and send_queued is 1,393, so the allowed increment is MAX minus (MAX minus 1,393) minus 1,393, which equals 0. The client's top-up is rejected as a connection level FLOW_CONTROL_ERROR and the connection is torn down before the excess credit can form.

The commit does not change ngx_http_v2_adjust_windows(), which still terminates individual streams on a SETTINGS_INITIAL_WINDOW_SIZE change rather than failing the whole connection. Rapid7 used that behavior to cancel queued streams while keeping the connection alive, but after the patch it no longer leads to an over-maximum connection window, because the client can no longer over-credit the window while frames are queued.

Detection Methods

No vendor published IDS signature, YARA rule, or Nuclei template existed for CVE-2026-123007 as of 18 November 2026, and CVETodo listed no published Sigma, Suricata, YARA, or Nuclei rules on that date. What exists is behavioral guidance from Rapid7, Wiz, Upwind, and CERT-EU, pointing to three layers: the network, the NGINX error log, and process telemetry.

Why your access log will not show it

The exploit runs entirely on low-level HTTP/2 control frames inside one TLS connection. The attacker slows reading of server output so DATA frames stay queued, raises credit with WINDOW_UPDATE frames, and sends a SETTINGS frame that increases SETTINGS_INITIAL_WINDOW_SIZE. NGINX resets the affected streams but leaves the connection open, and request cleanup pushes h2c->send_window above the maximum, after which many more WINDOW_UPDATE frames drive the counter past 2^63. Upwind sums it up: watch volume, not the access log. WAF rules that inspect URLs and request bodies cannot see WINDOW_UPDATE or RST_STREAM abuse, and a clean access log proves nothing.

Network layer: one huge, lopsided, long-lived connection

The most reliable signal is the sheer data volume. Each connection WINDOW_UPDATE is 13 bytes, and roughly 2^32 are needed to pass 2^63, about 52 GiB of control frames alone. Rapid7's working RCE sends about 119 GiB of plaintext, roughly 128 GB on the wire; Upwind estimates about 60 GB to crash a worker. Upwind's indicator is a single TLS connection with tens of GB inbound and little outbound. Practical approaches:

  • Use flow data (NetFlow/IPFIX, load balancer or firewall session logs) to alert on client-to-server bytes per connection to NGINX TLS listeners. Normal browsing almost never sends tens of GB upstream on one connection.
  • Watch connection duration. NGINX's default one-hour connection lifetime is the practical ceiling; at 1 Gbit/s the attack takes about 17 minutes and at 10 Gbit/s about 2 minutes. Look for sessions lasting minutes to an hour with sustained, high, mostly inbound throughput.
  • If you can decode HTTP/2, count connection level WINDOW_UPDATE frames (stream ID 0) per connection; billions are the giveaway. A SETTINGS change to INITIAL_WINDOW_SIZE followed by server sent RST_STREAM with FLOW_CONTROL_ERROR fits the stream termination step.
  • Upwind lists two artifacts specific to Rapid7's public PoC: about 262,000 TLS 1.3 KeyUpdates and 16 MB HEADERS frames. Modified exploits may not show them, but they are strong evidence when present.

Host layer: worker crashes in the NGINX error log

The heap overflow is usually followed by a worker segmentation fault, so failed or partial attempts and the roughly 60 GB DoS variant leave crash messages. CERT-EU recommends watching for worker process ... exited on signal in the error log, warning it signals attempts rather than confirmed RCE. Upwind names exited on signal 11 (or 6) specifically. Crashes shortly after a long, heavy HTTP/2 session from the same client are much stronger evidence than either signal alone. Note that worker_connections are not enough, reusing connections is a precondition for the sibling bug CVE-2026-123633, not this CVE.

Post-exploitation: NGINX workers starting programs

Code runs with the worker's permissions, so a worker starting any program is the clearest sign of success. Security Arsenal published experimental Sigma, KQL, and Velociraptor hunts. Their Sigma rule matches an /nginx parent whose command line contains worker process and a child that is a shell, interpreter, or download tool:

logsource: category: process_creation product: linux detection: selection_parent: ParentImage|endswith: - '/nginx' ParentCommandLine|contains: - 'worker process' selection_child: Image|endswith: - '/sh' - '/bash' - '/python3' - '/curl' - '/wget' - '/nc' condition: selection_parent and selection_child

The companion KQL hunt for Defender for Endpoint on Linux works the same way:

DeviceProcessEvents | where TimeGenerated > ago(7d) | where InitiatingProcessFileName =~ "nginx" | where FileName in~ ("sh", "bash", "dash", "zsh", "python", "python3", "perl", "curl", "wget", "nc", "ncat", "socat") | project TimeGenerated, DeviceName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName

Caveats: this content is community authored and marked experimental. Its crash rule matches any message containing worker process, which is noisy, so tighten it to the exited on signal strings. Its outbound connection rule only works if you tune the allowed port list to your real upstream topology. Its 499-ratio access-log hunt assumes the exploit relies on client RST_STREAM floods, but Rapid7's write-up has NGINX reset the streams itself after a SETTINGS change, so treat high 499 rates as a weak supporting signal at best. The Xint research behind NGINX2Root shows the worker foothold can be chained with a Linux SCTP kernel bug to get host root even from inside Docker, so also alert on SCTP module loads or SCTP socket activity on web hosts that do not normally use SCTP.

Exposure checks

Only NGINX 1.9.5 through 1.31.8 (and affected NGINX Plus builds) with HTTP/2 enabled on a TLS listener are exploitable, and the out of bounds copy only happens in the TLS send path. To check: search nginx -T output for http2 on or http2 on a listen line; confirm from outside with openssl s_client -alpn h2; for distro packages compare the full package release with your vendor's advisory, since backported fixes leave nginx -v showing the old version. Upwind notes that L7 load balancers or CDNs that terminate HTTP/2 (ALB, CloudFront, Cloudflare) rebuild the frames and probably break the exploit, so direct or L4-exposed listeners are where network monitoring matters most.

Affected Systems and Versions

Per F5's advisory and the nginx security advisories page:

  • NGINX Open Source: versions 1.9.5 through 1.30.6 are fixed in 1.30.7 (stable); versions 1.31.0 through 1.31.8 are fixed in 1.31.9 (mainline). The advisories page lists 1.9.5 through 1.31.8 as vulnerable.
  • NGINX Plus: versions 37.1.0 through 37.2.0.1 are fixed in 37.3.0.1; versions 37.0.0 through 37.0.7.1 are fixed in 37.0.8.1.
  • NGINX Plus R34 through R36: no fix on that line per Rapid7, which lists "None", so those users must move to a fixed branch.

Exploitation requires HTTP/2 enabled on a TLS listener. F5 states it does not evaluate software versions that have reached End of Technical Support, so the advisory's assessed version information should not be assumed to establish the status of unsupported releases.

Vendor Security History

F5 completed its acquisition of NGINX on May 9, 2019. F5's 2025 annual report discloses a security incident reported on October 15, 2025 involving long term persistent access to F5 systems and exfiltration of certain files, while stating F5 had no evidence that the actor accessed or modified NGINX source code or its product development environment. The reviewed sources do not establish a connection between that incident and CVE-2026-123007.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization