L
o
a
d
i
n
g
.
.
.

security

nginx CVE-2026-123007: a flow control window that grew past its limit

By Michele Zonca

#security

#nginx

#http2

24 November 2026

8 minutes to read

November 24, 2026

On 18 November nginx released 1.31.9 (mainline) and 1.30.7 (stable). The release fixes ten CVEs. Coverage has focused on five of them, grouped under the name “NGINX2Root”, and in particular on CVE-2026-123007, a memory corruption bug in HTTP/2 flow control that has been in the code since 1.9.5, the release that introduced HTTP/2 in September 2015. I have not reproduced it. What follows comes from the F5 advisory, the nginx changelog and the commit that fixes it. Where I add my own reading of the code, I say so.

What was fixed

The nginx security advisories page lists the 1.31.9 batch as follows:

  • CVE-2026-123007, memory corruption in HTTP/2 flow control (major)
  • CVE-2026-118899, infinite loop while reading a client request body over TLS 1.3 (major)
  • CVE-2026-113425, use-after-free in the mail proxy module (major)
  • CVE-2026-123633, use-after-free in HTTP/2 when worker_connections are not enough (medium)
  • CVE-2026-121810, the same for HTTP/3 (medium)
  • CVE-2026-123634, use-after-free in the resolver when the same name is resolved in concurrent subrequests (medium)
  • CVE-2026-120967, client certificates in the stream module checked against the default server instead of the one selected by SNI (medium)
  • CVE-2026-125283, buffer overflow with alias and try_files (minor)
  • CVE-2026-120993, NULL pointer dereference with PROXY protocol v2 and dynamic certificates (minor, 1.31.x only)
  • CVE-2026-123640, insufficient validation in ngx_stream_ssl_preread_module (minor)

On 23 November a further release, 1.31.10 and 1.30.8, fixed CVE-2026-132779: excessive CPU usage with ssl_early_data. So the version to be on today is 1.31.10 or 1.30.8, not the one most articles mention.

How HTTP/2 flow control works in nginx

HTTP/2 lets the receiver limit how much data the sender can have in flight, per stream and per connection. The receiver advertises a window, the sender subtracts every DATA frame it sends, and the receiver grows the window again with WINDOW_UPDATE frames. RFC 9113 caps a window at 2³¹−1 bytes, and a peer that pushes it beyond that commits a protocol error.

nginx keeps the connection window in h2c->send_window, a size_t. Two details of the implementation matter here:

  1. When nginx queues a DATA frame, it subtracts the frame size from send_window immediately, at queuing time, not when the frame is actually written to the socket.
  2. When a stream is terminated before its queued frames are sent, ngx_http_v2_filter_cleanup() gives the unsent bytes back: h2c->send_window += window.

The check on an incoming WINDOW_UPDATE was:

if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) {
    /* flow control error */
}

The bug

The check only looked at the current window, not at the bytes that had been subtracted for frames still sitting in the queue. The sequence described in the commit message is:

  1. nginx queues some DATA frames for a stream, and send_window goes down by their size.
  2. The client sends a WINDOW_UPDATE that brings send_window up to the maximum. This passes the check.
  3. The client terminates the stream. The cleanup handler refunds the unsent bytes, and send_window ends up above 2³¹−1.

The commit says this “eventually resulted in broken buffer size control in ngx_http_v2_send_chain() followed by memory corruption”.

The next step is my reading of the code, and it matches the CWE that F5 assigned (CWE-191, integer underflow). NGX_HTTP_V2_MAX_WINDOW is an unsigned int and send_window is a size_t. Once send_window is larger than the maximum, NGX_HTTP_V2_MAX_WINDOW - h2c->send_window wraps around to a very large number, and the check above stops rejecting anything. The changelog calls it a window overflow, F5 calls it an underflow. They are describing two moments of the same mistake: the window goes over the limit, and then the subtraction that was supposed to enforce the limit goes under zero.

The fix

The fix adds a counter, send_queued, to the connection. It grows when a DATA frame is queued and shrinks when the frame is sent or refunded. The check becomes:

if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window - h2c->send_queued) {

The reasoning in the commit message is one sentence: “From the client’s point of view, the queued frames still belong to the flow control window.” That is the whole bug. nginx treated bytes as spent when it reserved them, while the client counted them as spent only once they arrived. For eleven years the two views agreed often enough, and the case where they did not needed a stream to be reset at the right moment.

The diff is four added lines and two changed ones.

What the scores say

The F5 advisory gives two scores:

  • CVSS 3.1: 8.1, High (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)
  • CVSS 4.0: 9.2, Critical

Most coverage quotes the 9.2. The detail I find more useful is AC:H. F5 describes the impact as a worker crash or memory corruption, and code execution “on systems with Address Space Layout Randomization (ASLR) disabled or when the attacker can bypass ASLR”. Press reports say a public proof of concept exists and that one research group combined the bug with a Linux kernel flaw to get root on the host. I have not seen that work directly, and the F5 advisory does not mention it.

The advisory lists BIG-IP, BIG-IQ and F5OS as not vulnerable. NGINX Plus is fixed in 37.3.0.1 and 37.0.8.1. Several products built on nginx, such as the Ingress Controller, Gateway Fabric and F5 WAF for NGINX, are affected, and some of their branches have no fix yet.

Four reports for one bug

The acknowledgments section of the advisory credits four parties: Stephen Fewer of Rapid7, Tomer Schwartz of Wiz Research, Xint.io, and Ikotas Labs, the last “using GPT-6 Astra”.

In September I wrote about GPT-6 Astra being the first OpenAI model rated “Critical” for cybersecurity. That post was about a classification on paper. This is one concrete data point: a bug that sat in one of the most widely deployed web servers for eleven years was reported by four parties in the same disclosure cycle, and at least one of them used a model to find it. I do not know how the other three found it, and one data point does not say much about rates. It does suggest that the time a bug like this stays unknown is getting shorter, for defenders and attackers alike.

What I take from it

  • Upgrade to 1.31.10 or 1.30.8, or the distribution backport, and restart nginx. On NGINX Plus, 37.3.0.1 or 37.0.8.1.
  • F5 lists the mitigation as “None”. The vulnerable code is only reachable with HTTP/2 enabled, so turning off http2 removes this particular path, at the cost of HTTP/2 itself. It does nothing for the other nine CVEs.
  • If nginx is embedded in something else (an ingress controller, an appliance, a container image), the version that matters is the one inside it, not the one on the host.
  • More generally: when a resource is reserved in one place and released in another, every check on that resource has to count what is reserved as well as what is free. Here the limit was enforced against one of the two numbers.

Sources: F5 advisory K000163926; nginx changelog for 1.31.9 and 1.31.10; nginx commit e27f5fa8, “HTTP/2: account for queued frames when validating WINDOW_UPDATE”; nginx security advisories page.