CVE-2026-123007: nginx HTTP/2 Send Window Overflow -- Four Billion WINDOW_UPDATE Frames to a Worker Crash
The advisory
nginx is one of the most widely deployed web servers and reverse proxies, and HTTP/2 over TLS is a common way to run it. On 2026-11-18 nginx.org published “Memory corruption in HTTP/2 flow control”, CVE-2026-123007, for every release from 1.9.5 through 1.31.8. The advisory’s own words for the impact are “segmentation fault in a worker process, or might have potential other impact”. The bug has also been described publicly as leading to remote code execution, and it carries a CVSS 4.0 score of 9.2.
I set out to reproduce it on stock nginx and see how far the advisory’s sentence could be turned into something observable. What I can show is the first half: one unauthenticated HTTP/2 connection kills a worker process of nginx 1.30.6 from the official image with SIGSEGV, and an AddressSanitizer build of the same commit names the call that does it, a memcpy in the TLS send path whose length is 0x80000000243e3ffa. I did not attempt code execution, so that part stays “not reached”. nginx 1.30.7 refuses the attack at its first step.
The catch is the price. The crash costs 4,294,967,300 WINDOW_UPDATE frames, about 60 GiB of traffic on a single connection, and most of this post is about why nginx makes it that expensive.
PoC, live capture, evidence and detection rules: al4n4n/achilles-heel/CVE-2026-123007
How nginx does HTTP/2 flow control
HTTP/2 multiplexes many requests (“streams”) over one TCP connection. To stop a fast sender from flooding a slow receiver, the protocol has credit-based flow control. Every stream has a send window and the connection as a whole has one too. A sender may only emit DATA while both windows are positive, and each DATA frame is subtracted from both. The receiver hands credit back with WINDOW_UPDATE frames, one per stream or for the connection (stream 0).
Two rules of the protocol matter here. A window may never exceed 2^31-1; a WINDOW_UPDATE that would push it higher is a flow-control error and the connection must be closed. And any stream can be cancelled by the client at any time with RST_STREAM.
In nginx the connection window lives in h2c->send_window, and the limit is NGX_HTTP_V2_MAX_WINDOW. A response body reaches the client in three steps. The HTTP/2 filter, ngx_http_v2_send_chain(), cuts it into DATA frames and puts them on the connection’s output queue. ngx_http_v2_send_output_queue() hands the queue to the transport. On a TLS connection the transport is ngx_ssl_send_chain(), which copies the frames into a 16 KiB buffer on their way to being encrypted.
The detail that makes this bug possible is the moment at which nginx does the bookkeeping. The window is debited when a DATA frame is queued, not when it is written to the socket. Normally the difference is invisible, because nginx writes queued frames at once whenever the socket is writable. It only shows if the socket is full: then frames sit in the queue, already paid for, but not yet sent.
The vulnerable code
I started from the fix commit, b89c4100 (“HTTP/2: account for queued frames when validating WINDOW_UPDATE”), and read the 1.30.6 sources backwards from it to the frames that reach the code, and forwards to wherever the bad value ends up. Three statements in three functions are the whole root cause. These are the statements that matter, lifted out of their functions:
1 | /* ngx_http_v2_send_chain(), ngx_http_v2_filter_module.c:1226 |
Each one is reasonable alone. Together they count the same bytes twice. Suppose 8 MB of DATA sits in the queue. The window has already been debited by 8 MB, so the check in the middle will let the client send a WINDOW_UPDATE for those 8 MB: as far as the check can tell, the window has room. Now the client cancels the streams. The cleanup handler sees 8 MB of frames that will never be sent and, correctly, gives the window back what was debited for them. The client has been credited once by its own WINDOW_UPDATE and once by the refund. The window is now above 2^31-1, a state the code assumes cannot exist.
What happens next is the part I like. send_window is a size_t. Once it is larger than NGX_HTTP_V2_MAX_WINDOW, the subtraction on the right-hand side of the check wraps around to an enormous unsigned number, and no increment is ever greater than that. The one guard on the window has switched itself off. Every further WINDOW_UPDATE is accepted, and the window can be grown to any 64-bit value.
The sink is two files away:
1 | /* ngx_http_v2_send_chain(), ngx_http_v2_filter_module.c:1129 */ |
When nginx builds the next DATA frame it compares the amount it wants to send with the window, cast to a signed off_t. A window of 2^63 or more is negative as an off_t, so the limit becomes negative, ngx_http_v2_filter_get_shadow() builds a buffer whose last pointer is pos plus a negative number, and ngx_ssl_send_chain() computes a negative size. There are two clamps on size before the copy, but both only cap it from above. A negative value passes them and arrives at memcpy as a length of about 2^63.
The trigger
On paper the recipe is short: queue some DATA, send a WINDOW_UPDATE for it, cancel the streams, then inflate the window and ask for one more frame. The preconditions are equally short. HTTP/2 must be enabled, and for the memcpy sink shown here the connection must be TLS. No authentication is involved, and every frame is an ordinary one that a normal client sends all day.
In practice nginx has four mechanisms that get in the way, none of them written for this bug. I found them one at a time while building the PoC.
The queue empties itself. nginx writes queued frames as soon as the socket accepts them, so the frames have to be held in the queue while WINDOW_UPDATE and RST_STREAM are processed. The way to do that is to fill the TCP path: open the window of one stream, the “plug”, and stop reading. nginx writes until the kernel buffers on both sides are full and then blocks. Everything it queues after that stays queued.
Only whole, untouched frames are refunded. A frame that has been partly written is marked blocked and is not refunded on cancellation. And one stream can only queue what one send_chain call produces, 65536 bytes with the default output_buffers 2 32k. So the refund has to come from many streams: 127 of them, 8323072 bytes, and that has to be more than what the TCP path swallowed for the plug.
The flood guard. nginx closes an HTTP/2 connection when total_bytes / 8 > payload_bytes + 1048576. WINDOW_UPDATE frames are not payload. By that formula a connection that carries nothing but control frames is cut off after about 8 MiB, so one eighth of the whole exchange has to be DATA from the server.
The idle guard. With no stream open, nginx counts every read on the connection and closes it after ten times keepalive_requests. My first attempt at the flood died here, with http2 flood detected in the info log. One request has to stay open the whole time.
Walking the attack
The script, poc.py, does it in three stages on one connection.
Stage 1: overflow
It sends SETTINGS with INITIAL_WINDOW_SIZE=0, so no stream can send any DATA, and a connection WINDOW_UPDATE that takes the connection window from its initial 65535 to exactly 2^31-1. Then it sends 128 GET requests for a static file, the default limit for concurrent streams. nginx answers all of them with headers and no body.
Next it gives stream 255, the plug, a window of 6 MiB and stops reading from the socket. nginx starts sending and blocks in write. Now comes one burst, small enough to travel in a single packet: 127 stream WINDOW_UPDATEs of 65536 bytes, a connection WINDOW_UPDATE for the same 8323072 bytes, and 128 RST_STREAM frames.
nginx processes them in order. For each of the 127 streams it builds 65536 bytes of DATA, queues them behind the blocked write and debits the window. It accepts the connection WINDOW_UPDATE, because the debit made room for it. Then it handles the cancellations and refunds everything that is still queued.
The script cannot read nginx’s memory, but it does not have to. The window is fully determined by what the client sent and received: the initial window, plus every credit it sent, minus every DATA byte that actually arrived, because every byte that did not arrive was refunded. After the burst it drains the socket and counts 4243456 bytes on the plug stream and nothing on the others. That puts the window at 2147483647 + 8323072 - 4243456 = 2151563263, which is 4079616 above the limit.
To prove it without crashing anything, the script sends one WINDOW_UPDATE of 2^31-1. A correct server must answer that with GOAWAY. This one answers the PING that follows.
Stage 2: grow
From here the window only needs to get big. Each WINDOW_UPDATE adds at most 2^31-1, so reaching 2^63 takes 2^32 of them. I looked for a shortcut and did not find one: every increase is a 13-byte frame worth at most 2^31-1, and the refund path is net zero. 2^32 frames of 13 bytes is 52.0 GiB.
The flood guard turns that into a download job as well. One eighth of the exchange has to be payload, which is 7.4 GiB of response DATA. Request bodies do not help with a static file, because nginx discards them without counting. And keepalive_requests caps a connection at 1000 requests, of which stage 1 already used 128. That is why the lab serves a 64 MiB file: 119 downloads of it fit in the budget. A site that only has small responses was not tested, and I expect it to stop the attack at the flood guard.
So stage 2 is a loop: send a batch of WINDOW_UPDATE frames, 1260 to a TLS record, keep one download running, read what comes back, and never let the ratio slip. On loopback it takes 41 seconds.
Stage 3: trigger
The window is now 2^63 plus a little. The script opens one more stream, checks with a PING that the connection is healthy, and gives that stream a window of 16384 bytes. nginx goes to build a single DATA frame.
The crash
This is the run that ships in the repository, against the stock binary, from evidence/poc-vuln.txt. I have cut the progress lines of stage 2:
1 | [*] Target 127.0.0.1:8443 answers: HTTP/1.1 200 OK, Server: nginx/1.30.6 |
The line to look at is “0 of 8323072 bytes on the cancelled streams”. Those bytes were credited and never delivered. The numbers close, too: the final window is the 2151563263 from stage 1, plus 4294967301 increments of 2^31-1 (the probe and the flood), minus the 7985954816 bytes of the 119 completed downloads.
A dropped connection is not proof of a crash by itself, so here is the server’s side of the same second, from evidence/target-vuln.txt:
1 | 2026/11/18 23:02:56 [notice] 1#1: signal 17 (SIGCHLD) received from 28 |
Signal 11, on a binary I did not build. But a signal is not a location. I wanted the backtrace, and the lab host pipes core dumps to apport, which throws away cores from containers. Instead of fighting that, I rebuilt the same commit (fb0e979c, the 1.30.6 release tag) with AddressSanitizer and the same configure modules as the package, and ran the same script against it. From evidence/target-vuln-asan.txt:
1 | ==28==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x529009b78209,0x800052902df5c203) and [0x52d000a1e400, 0x800052d024e023fa) overlap |
Read it from the bottom of the stack. Frame 23 is the WINDOW_UPDATE handler: the trigger frame arrived and woke the stream. Frame 4 is ngx_http_v2_send_chain() building the DATA frame. Frame 1 is ngx_ssl_send_chain() at line 3117, the copy into the TLS buffer.
The report type looks odd for an overflow. AddressSanitizer checks the arguments of memcpy before it lets the copy run, and with a length this size the first thing it notices is that source and destination overlap. Subtract the ends of either range and you get 0x80000000243e3ffa, exactly the window the script printed. The destination starts 9 bytes into a 16384-byte heap region allocated in ngx_ssl_send_chain() at line 3074, the TLS buffer. Nine bytes is the size of an HTTP/2 frame header, presumably the one for this DATA frame. The source is a 32768-byte file buffer.
Two limits of this proof are worth stating. AddressSanitizer stops the call before a single byte is copied, so the report shows the arguments, not what gets overwritten. And on the stock build I have the signal but no backtrace, so “the SIGSEGV is inside this memcpy” rests on the sanitizer build of the same commit, not on a core dump of the stock one.
Negative control
The same script, unchanged, against nginx 1.30.7 from the official image (evidence/poc-patched.txt):
1 | [*] Target 127.0.0.1:8444 answers: HTTP/1.1 200 OK, Server: nginx/1.30.7 |
And the patched server says why, in evidence/target-patched.txt:
1 | 2026/11/18 23:04:49 [info] 29#29: *3 client violated connection flow control: received WINDOW_UPDATE frame with window increment 8323072 not allowed for window 2143248383 while processing HTTP/2 connection, client: 127.0.0.1, server: 127.0.0.1:8444 |
The whole run takes about two seconds and no worker exits. The fix stops the attack at the first frame that matters.
Impact
What I demonstrated is an unauthenticated remote crash of one nginx worker. The worker that owns the attack connection dies, and the master starts a replacement within the same second. One run takes about 45 seconds and 60 GiB on loopback. I did not try to keep all workers down, so I make no claim about a sustained outage.
In this lab the result was deterministic. Every run that reached stage 3 crashed the worker: four on the stock build and two on the sanitizer build, and 1.30.7 refused all four attempts. The one way I know to make it fail is a network path that buffers more than the 8323072 bytes of stage 1. Docker’s own port publishing does that, as does an ssh tunnel: the queued frames get sent, the refund never happens, and the script notices and stops. That is why the lab containers share the host’s network namespace and why the script runs on the lab host. It also means that a buffering proxy in front of nginx breaks this PoC as written. I would not read that as a mitigation.
| Claim | Status | Evidence |
|---|---|---|
| Connection send window pushed above 2^31-1 on stock 1.30.6 | Proven | evidence/poc-vuln.txt, capture/exploit.pcap |
| 4294967300 further WINDOW_UPDATE frames accepted, window reaches 2^63 | Proven | evidence/poc-vuln.txt |
| Worker SIGSEGV on the next DATA frame, unauthenticated, over the network | Proven | evidence/poc-vuln.txt, evidence/target-vuln.txt |
The faulting call is memcpy in ngx_ssl_send_chain (ngx_event_openssl.c:3117), length 0x80000000243e3ffa |
Proven on the AddressSanitizer build of the same commit | evidence/target-vuln-asan.txt |
| nginx 1.30.7 refuses the attack and does not crash | Confirmed | evidence/poc-patched.txt, evidence/target-patched.txt |
| Remote code execution, ASLR bypass | Not reached | Not attempted |
| Heap contents overwritten before the fault on the stock build | Not reached | No core of the stock crash; the sanitizer stops before the copy |
| Denial of service beyond one worker | Not reached | Not attempted |
| A compact trigger, megabytes instead of gigabytes | Not reached | No shorter path to a negative window found |
| Cleartext HTTP/2 (h2c) | Not reached | Not tested; the lab has no cleartext listener |
| Attack through a buffering proxy or tunnel | Not reached | Tried through docker-proxy and an ssh port-forward: stage 1 fails |
“Not reached” means what it says. The value that reaches memcpy here is 2^63 plus a remainder, because the sign bit is all a crash needs. I did not explore what other values would do.
Detection
The attack is HTTP/2 inside TLS 1.3. A network sensor that does not terminate TLS sees no frames at all, only one long-lived connection that carries about 52 GiB from client to server against 7.4 GiB the other way. I wrote no network rule: a Suricata rule could not be validated against an encrypted capture, and a volume heuristic would not be specific to this bug.
What nginx logs is more useful. The repository has two Sigma rules for the error log, both experimental / minimally validated. Each was tested only against the log of my one attack run and against one benign sample, nginx 1.30.7 starting up and serving normal HTTP/2 requests. Nobody has measured their false-positive rate.
cve-2026-123007-crash.ymlmatchesworker process N exited on signal 11. It works at the stock log level, and it fires on any worker SIGSEGV, whatever the cause. A worker dying on signal 11 deserves a look in any case.cve-2026-123007-stream-cancel.ymlmatchesclient canceled stream. Stage 1 leaves 128 of these on one connection within one second. It needserror_logatinfo, which is not the default, and a threshold in the SIEM (50 or more in 60 seconds) to be of any use, because single cancellations are normal traffic.
The rules and their limits are in detection/.
The fix
Commit b89c4100, “HTTP/2: account for queued frames when validating WINDOW_UPDATE”, adds a counter to the connection, h2c->send_queued, for the bytes in DATA frames that are queued but not yet sent. The bound in the WINDOW_UPDATE handler becomes:
1 | window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window - h2c->send_queued |
This goes to the cause and not the symptom. The window is still debited at queue time and still refunded on cancellation, but the client can no longer be credited for bytes that are only queued, so credit and refund cannot both land for the same bytes. The log line from the negative control is consistent with that. The window it reports, 2143248383, is 4235264 below the limit, about what the script saw arrive on the plug stream (4227072 bytes); the 8323072 queued bytes no longer make room for a WINDOW_UPDATE.
Affected: nginx 1.9.5 through 1.31.8. Fixed: 1.30.7 (stable) and 1.31.9 (mainline). If HTTP/2 is enabled, upgrade.
Advisory and fix
| Date | Event |
|---|---|
| 2026-11-18 | nginx.org publishes “Memory corruption in HTTP/2 flow control” (CVE-2026-123007, reported by Xint.io); fixed in nginx 1.30.7 and 1.31.9 |
| 2026-11-18 | Reproduction and this write-up |
References: nginx security advisories, F5 article K000163926, fix commit b89c4100.
Reproduction
Everything above can be checked from the repository. You need a Linux x86_64 host with Docker and Python 3; the scripts use only the standard library. Run poc.py on the Docker host itself, since stage 1 needs a direct TCP connection to nginx.
1 | git clone https://github.com/al4n4n/achilles-heel.git |
The capture in the repository is partial by design, since nobody wants a 60 GiB pcap: the first 700 packets with a TLS key log that decrypts them, which covers all of stage 1, and every SYN, FIN and RST of the run. The full evidence, the capture and the rules are at al4n4n/achilles-heel/CVE-2026-123007.