Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 7 min read

9.2 RCE in nginx's HTTP/2: I verified the 11-year bug

9.2 RCE in nginx's HTTP/2: I verified the 11-year bug Two unauthenticated remote code execution flaws in nginx, both rated CVSS 4.0 9.2, disclosed today. One of them has been hiding in the HTTP/2 code since version 1.9

9.2 RCE in nginx's HTTP/2: I verified the 11-year bug

Two unauthenticated remote code execution flaws in nginx, both rated CVSS 4.0 9.2, disclosed today. One of them has been hiding in the HTTP/2 code since version 1.9.5 β€” released in 2015. I read the vulnerable source and the fix, line by line, and the bug in the first one is a single missing line. The fix is already on Docker Hub. Ubuntu's apt still serves a vulnerable build, and Ubuntu's own CVE tracker lists every supported release as vulnerable with no fixed version yet.

What dropped today

Wiz Research disclosed two critical HTTP/2 vulnerabilities in nginx this morning (November 18, 2026), coordinated with F5. Five independent research teams β€” Wiz, Ikotas Labs, Metnir, Rapid7, and Xint β€” found the same flaws. The F5 security release that went out with the disclosure fixes ten CVEs in total, but these two are the ones that matter:

CVE-2026-123007  HTTP/2 send_window integer underflow   CVSS 4.0 9.2   1.9.5–1.31.8
CVE-2026-123633  HTTP/2 connection use-after-free       CVSS 4.0 9.2   1.19.7–1.31.8

Fixed in 1.30.7 (stable) and 1.31.9 (mainline). Both require HTTP/2 to be enabled β€” nginx does not turn it on by default, so a stock install with no http2 directive is not exposed. But any HTTPS site that enabled HTTP/2, which is most of them, is in scope if the version matches. Wiz confirmed remote code execution with an ASLR bypass on official nginx 1.31.7 and 1.31.8 builds. Their proof-of-concept exploits are not public, and I did not build one β€” everything below is source reading and the public fix diff, which is enough to verify the mechanism exactly.

Bug one: the connection that forgot to un-reusable itself

nginx keeps a list of connections it can close when it runs low on free connection slots. An HTTP/2 connection joins that list when it has no active requests, and must leave it the moment a request starts. In the vulnerable 1.31.8 source, ngx_http_v2_handle_connection() marks the connection reusable while waiting for the rest of a split HEADERS frame:

ngx_reusable_connection(c, 1);

if (h2c->state.incomplete) {
    return;
}

Then ngx_http_v2_create_stream() starts processing the request β€” h2c->processing++ β€” but never takes the connection off the reusable list. The request is now running on a connection nginx still considers safe to close.

When the request is proxied upstream, nginx opens an upstream connection, and if free slots run low, ngx_drain_connections() picks reusable connections to close β€” including this one, mid-request. Before closing it, nginx tries to send a GOAWAY frame; if it can't (the connection has hit its internal frame limit), the error path closes the connection and frees its memory. Processing then resumes in the original request, which still uses that memory. Use-after-free, unauthenticated, over HTTP/2.

The fix, in 1.31.9, is one line added to ngx_http_v2_create_stream(), right after h2c->processing++:

h2c->processing++;

ngx_reusable_connection(h2c->connection, 0);

I diffed the 1.31.8 and 1.31.9 sources myself β€” that line is the entire fix for CVE-2026-123633. Six years of exposure, one missing call. The bug needs a proxy configuration and low free-connection slots to trigger, which is why Wiz calls it the harder of the two to exploit. "Harder" is doing a lot of work there; the condition is a busy reverse proxy, which is what nginx usually is.

Bug two: the refund that overflowed the window

This one is arithmetic, and it works even when nginx is serving plain static files over HTTPS β€” no backend, no third-party module. HTTP/2 flow control tracks how much response data nginx may send in h2c->send_window. When nginx queues response data it subtracts the size; if a stream is cancelled while data is still queued, ngx_http_v2_filter_cleanup() returns the unused allowance:

h2c->send_window += window;

No check. If the client has already increased the allowance with WINDOW_UPDATE frames while that data was waiting, the refund pushes send_window above the protocol maximum, NGX_HTTP_V2_MAX_WINDOW β€” 2,147,483,647, or 2^31 βˆ’ 1.

The next problem is the bounds check in ngx_http_v2_state_window_update(), which is supposed to catch exactly this:

if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window)

send_window is an unsigned integer. Once it is already past the maximum, NGX_HTTP_V2_MAX_WINDOW - h2c->send_window wraps around to a huge positive number, and the check concludes there is plenty of room. The invalid counter keeps growing β€” Wiz notes it takes a large number of WINDOW_UPDATE records β€” until it reaches ngx_http_v2_send_chain(), where it is converted to the signed type off_t, goes negative, and leaves a buffer's end pointer before its start pointer. The TLS send path turns that into an out-of-bounds memory copy. Memory disclosure, heap corruption, remote code execution.

The 1.31.9 fix adds a new counter, send_queued, that tracks bytes queued but not yet sent, and subtracts it in the check:

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

It also narrows the refund in ngx_http_v2_filter_cleanup() so only actual data frames get their bytes back, not every frame type. Again, I verified this by diffing the 1.31.8 and 1.31.9 sources β€” the fix is a small, surgical change to the accounting, not a rewrite.

The patch gap, measured this morning

The fix exists. The question is whether the places people actually install nginx from have it. I checked three:

Docker Hub nginx:1.30.7   pushed 2026-11-18 19:52 UTC   fixed
Docker Hub nginx:1.31.9   pushed 2026-11-18 19:53 UTC   fixed
Ubuntu 24.04 apt nginx    candidate 1.24.0-2ubuntu7.19  VULNERABLE (in 1.9.5–1.31.8)

Ubuntu's CVE tracker, pulled this morning, lists resolute, noble, jammy, focal, bionic, and xenial all as "Vulnerable" for both CVE-2026-123007 and CVE-2026-123633, with no fixed version published for any of them yet. The 1.24.0 in noble's archive is inside both affected ranges. Distro packaging lags upstream by design β€” Ubuntu will backport the fix into 1.24.0 rather than ship 1.30.7 β€” but as of this morning, apt install nginx on Ubuntu 24.04 gives you a build with both flaws, and there is nothing to upgrade to yet.

That is the same shape as the Postgres story from last week: the fix is real, the package channel is a day or more behind, and the window between disclosure and distro patch is exactly when the risk is highest. The difference is the blast radius β€” nginx is, per Netcraft via Wiz, the front door of more than 225 million websites, and the flaw is in nginx itself, not in any application behind it. Your code can be perfect and still be exposed.

The AI part, because it is the story now

Wiz is explicit about how these were found: its Atlas harness, and "Gemini 4 Carbon and ChatGPT 5.6 Sol to validate the impact of both vulnerabilities." This is the third AI-assisted memory-safety discovery in about six weeks β€” PHP2Shell last month, Java4Shell yesterday (which I wrote about this morning), nginx today. Wiz's own framing is that complexity used to be a practical barrier to finding these bugs, and AI is dissolving it: five teams independently found the same two flaws, in code that had been reviewed for a decade.

I find that more alarming than the CVEs themselves. The 11-year-old underflow was not found for eleven years because tracing a refund through three functions and an unsigned wraparound is the kind of thing humans are bad at and models are now good at. The fix for one of them is a single line. The discovery pipeline is now faster than the patch pipeline β€” Docker Hub had the fix within hours, Ubuntu hasn't shipped it yet, and every hour in between is an hour where the bug is public and the patch is not installed.

What to do

Upgrade:  nginx 1.30.7 (stable) or 1.31.9 (mainline) β€” both on Docker Hub now
Can't upgrade yet:  http2 off;  in affected server blocks (1.25.1+),
  remove the http2 parameter from listen directives, reload,
  and confirm the old workers have actually exited
Watch for:  unexpected nginx worker crashes, or commands launched by nginx

If you run nginx as a reverse proxy with HTTP/2 on, this is a patch-today item, not a patch-this-week item. If you run it behind a CDN or WAF that terminates HTTP/2 itself, that may blunt the attack β€” Wiz says it depends on the implementation β€” but do not assume it. And if you are on Ubuntu, check your USN feed: the fixed 1.24.0 backport will arrive as a security update, and the version number to look for will not be 1.30.7.

Limits of what I verified

I read the 1.31.8 source and diffed it against 1.31.9 β€” the two mechanisms and both fixes check out against Wiz's write-up, function by function. I verified the fixed images exist on Docker Hub with today's timestamps, and that Ubuntu's apt candidate and CVE tracker still show vulnerable builds with no fixed version. I did not run an exploit: Wiz has not released one, and building one would mean heap-grooming a production web server, which is not something I do in a blog post. The RCE claim itself is Wiz's, confirmed on official 1.31.7 and 1.31.8 builds with an ASLR bypass. The CVSS 9.2 scores are Wiz's; nginx's own advisory page rates CVE-2026-123007 "major" and CVE-2026-123633 "medium" β€” the severity labels disagree, the version ranges do not.

Sources: Wiz, "Unauthenticated Remote Code Execution in NGINX: CVE-2026-123633 and CVE-2026-123007" (Nov 18, 2026); nginx security advisories (CVE-2026-123007: vulnerable 1.9.5–1.31.8; CVE-2026-123633: vulnerable 1.19.7–1.31.8; fixed 1.30.7+/1.31.9+); nginx source, release-1.31.8 tag, src/http/v2/ngx_http_v2.c and src/http/v2/ngx_http_v2_filter_module.c, diffed against release-1.31.9; Docker Hub API, library/nginx tags 1.30.7 and 1.31.9 (pushed Nov 18, 2026); Ubuntu apt-cache policy nginx (candidate 1.24.0-2ubuntu7.19) and Ubuntu CVE tracker pages for CVE-2026-123007 and CVE-2026-123633 (all supported releases "Vulnerable", no fixed version, pulled Nov 18, 2026).

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.