DEV Community

Mohammad Taha Azizi Ahad
Mohammad Taha Azizi Ahad

Posted on

A Bug That Sat in NGINX for Eleven Years Let Anyone Run Code on Your Server

On November 18, F5 shipped NGINX 1.31.9 and 1.30.7, and the changelog read like a normal security release. It was not. Buried in it was CVE-2026-123007, a memory corruption bug in HTTP/2 flow control that had been sitting in NGINX since version 1.9.5, released in September 2015. Eleven years. Every open source release since then was affected, as long as HTTP/2 was switched on. An attacker needed nothing more than a network connection to the server. No login, no account, no backend app, no third-party module.

I build a small encrypted messenger, so I spend a lot of time thinking about the layers I do not control. The proxy in front of your app is one of those layers. This week it reminded everyone why that matters.

What actually broke

HTTP/2 flow control is a simple idea. The server may only send so much data before the client says "send more." NGINX tracks that allowance in a counter called send_window. When a client cancels a request with data still queued, NGINX returns the unsent allowance to the counter. The bug: it returned that allowance without checking the protocol maximum.

So a client could raise the window, cancel at the right moment, and push the counter past the HTTP/2 maximum of 2^31 - 1. From there the code did an unsigned subtraction to validate the next WINDOW_UPDATE frame, and the subtraction wrapped around to a huge number, so the check passed. The attacker then sent a flood of WINDOW_UPDATE frames to drive the counter to whatever value they wanted. That value eventually became a signed length, went negative, and produced a response buffer whose end pointer sat before its start. In the TLS send path, that turned into an out-of-bounds memory copy.

Wiz demonstrated the full chain against official NGINX 1.31.7 and 1.31.8 builds serving plain static files over HTTPS, with no backend and no extra modules. Read memory, defeat ASLR, corrupt the heap, run code in the worker process. Rapid7 scored it 9.2 under CVSS 4.0. F5 called it major. Five separate research groups found it independently, which tells you something about how visible the flaw was once someone looked at the right function.

There are honest limits, and they matter. The public proof of concept needs TLS, roughly 128 GB of HTTP/2 traffic, and enough bandwidth that a slow connection gets cut off by the default one-hour connection limit. It runs code as the NGINX worker user, not root. On a busy production server the exploit is expected to fail; it works best against a freshly started container. None of that makes it harmless. A worker process is the process that terminates your TLS and routes your traffic. Own it and you can read requests and responses in transit, steal session tokens and the TLS keys the worker has loaded, change what users are served, and reach the internal apps NGINX is trusted to talk to.

It was five bugs, not one

The November 18 release fixed a batch, and the headline bug had company. CVE-2026-123633 is a use-after-free in HTTP/2 proxying, CVE-2026-121810 the same shape in HTTP/3, CVE-2026-123634 a resolver use-after-free going back to version 0.6.18, and CVE-2026-113425 a mail proxy bug from 0.5.33. Xint, which found four of the five, calls the set nginx2root, and the name is not a stretch: Xint chained the HTTP/2 bug with a separate, still unpatched Linux kernel flaw in the SCTP subsystem to get root, including an escape from a Docker container to the host.

Then on November 24, Unit 42 published a root-cause write-up of CVE-2026-123633 and showed it also turns into pre-auth code execution. In their two-VM demo the second attempt opened an interactive shell as the www-data worker. That chain needed a non-default configuration and a separate memory disclosure to leak a libc pointer, so F5 did not give the disclosure its own CVE, but the message is the same: these were not five isolated typos. They were five symptoms of the same old C code being asked to do things its authors never planned for.

As of November 25, none of the five CVEs is in CISA's Known Exploited Vulnerabilities catalog, and nobody has reported exploitation in the wild. That is good news and also the exact moment people stop patching.

Why it survived eleven years

This is the part I keep coming back to. The vulnerable code was not exotic. It was flow control, one of the most ordinary parts of HTTP/2, in one of the most reviewed codebases on the internet. The bug is a missing bounds check on a refund. That is the kind of thing a code review is supposed to catch, and it is also the kind of thing every reviewer skims past because the surrounding code looks correct and the function has worked fine for a decade.

It survived because it needed a very specific sequence to trigger: raise the window, cancel with data queued, then hammer WINDOW_UPDATE frames. Normal traffic never does that. Fuzzers apparently never did it in the right order either, or did and produced a crash nobody connected to a security bug. Eleven years of uptime is not evidence of correctness. It is evidence that the trigger was unusual.

There is a second reason, and it is less comfortable. NGINX is infrastructure. People install it, configure it once, and forget it exists until something breaks. Debian, Ubuntu, and RHEL patch it without changing the version string it reports, so nginx -v can lie to you about whether you are safe. The retired ingress-nginx controller bundles a vulnerable NGINX and will never ship a patch at all. The software that sits in front of everything gets the least attention of anything in the stack.

What to do, in order

First, upgrade. NGINX Open Source 1.30.7 (stable) or 1.31.9 (mainline), or NGINX Plus 37.0.8.1 or 37.3.0.1. Then restart the service, do not just reload. A reload keeps the old binary running, and the old binary is the vulnerable one. If you run the retired ingress-nginx controller, migrate; there is no fixed release coming.

If you cannot patch today, turn HTTP/2 off. One directive, http2 off;, closes the hole for the headline bug. It is a real trade-off, HTTP/2 is doing genuine work for your users, but a day without it beats a week with a known pre-auth RCE.

Then check the version properly. Compare the full package revision against your distribution's advisory, not the version string. Debian shipped fixes for bookworm and trixie on November 20. And if you run HTTP/3 or proxy HTTP/2 upstream, remember the other bugs in the batch need those configurations to matter, so check which of the five actually apply to you instead of assuming the upgrade covers a setup you never audited.

For hunting, Unit 42 suggests setting error_log to warn and looking for "worker_connections are not enough, reusing connections" near unexpected worker exits. Raising worker_connections only buys headroom; it is not a fix.

The part nobody wants to say

The security industry will file this under "patch your proxy" and move on by next week. But the pattern keeps repeating. OpenSSL had a 9.8 base64 overflow the same month. GPGME had a double-free from a long user ID. The code that everything depends on is old C, written when the threat model was different, and it keeps producing the same class of bug: a length nobody checked, a pointer nobody validated, a refund nobody capped.

Formal verification is starting to reach this code. DeepMind's AlphaProof Code proved properties of the crypto behind Signal and Google Messages this month, generating six million lines of Lean proofs. That is encouraging and also a measure of the gap: it took an agentic multi-model system four weeks to verify one implementation, with humans reviewing about one percent of it. We are a long way from that being routine for a web server.

So the practical lesson is boring, and boring is the point. The proxy in front of your app is part of your app. Patch it like you patch your app. Restart it like you restart your app. And when a bug has been in the code since 2015, assume there is another one from 2016 still waiting, because the code that has been stable the longest is the code nobody has looked at in the longest.

Check your NGINX version tonight. It takes thirty seconds, and the fix takes five minutes. The eleven-year-old bug did not need your password. It just needed your server to be reachable, and it was.

Top comments (0)