
Research kit for CVE-2026-123007 - NGINX HTTP/2 flow-control accounting bug leading to unauthenticated RCE
An independent research kit for the unauthenticated NGINX HTTP/2 vulnerability described by Rapid7 as critical HTTP/2 integer underflow leading to RCE.
This repository is a rewrite, not a mirror. The wire behaviour and the calibrated target data are preserved where the target requires them; the implementation, tool layout, trigger, tests, and analysis are new. See NOTICE.md for provenance.
Scope. Everything here is for authorized testing of systems you own or operate, and for defensive research. The RCE client is calibrated for two specific NGINX builds; it is not a general-purpose exploit.
NGINX tracks a connection-level send window and a per-stream window for every
HTTP/2 response. When response DATA is queued, its length is charged against
the connection window. When a stream is closed while such DATA is still
untransmitted, HTTP/2 output cleanup refunds that length. A SETTINGS change
that makes a stream window illegal closes the stream on a path that does not
restore the "window ≤ 2³¹−1" invariant first. The refund therefore pushes the
connection window above HTTP/2's maximum. The WINDOW_UPDATE guard computes
MAX - current in unsigned arithmetic; once current > MAX that subtraction
underflows and every subsequent maximum increment is accepted. Roughly 2³² of
them walk a 64-bit window through its signed midpoint, turning it into a
negative output length. NGINX inverts an output buffer around that length, the
TLS coalescer passes the negative distance to memcpy as a huge size_t, and
glibc's CPU-selected copy routine wraps at the address-space boundary — which
both discloses memory and overwrites an adjacent request pool.
Details, with the exact state transitions and arithmetic:
poc/
trigger.py portable accounting oracle + crash amplifier
exploit.py calibrated RCE client entry point
profile_tool.py validate, summarize, or remotely fingerprint a profile
h2kit/ HTTP/2 frames, HPACK subset, TLS 1.3 record engine
nginxh2/ prime → wrap → layout → leak → reclaim → execute
profiles/ validated target calibrations (JSON)
native/h2blast.c constant-memory multi-gigabyte record sender
tests/ offline component suite (41 tests)
lab/
nginx.conf minimal HTTP/2-over-TLS listener
reproduce.sh build, start, verify, run, clean up
poc/trigger.py — proving the root causeThe trigger is deliberately portable. Unlike earlier reproductions it does
not read CPython's private SSLSocket layout through ctypes; it performs the
handshake with ssl while a key log is enabled, then writes its own TLS 1.3
records from the logged traffic secret. That works on any CPython 3.8+ with
OpenSSL 3.
python poc/trigger.py https://127.0.0.1:19443/ --skip-amplifier
python poc/trigger.py https://127.0.0.1:19443/
The first command stops after the accounting oracle: it prints
cleanup over-credit confirmed: connection window exceeded MAX and later frames are still accepted
and exits zero. That statement is independently checkable: the target reset
both over-credited streams with FLOW_CONTROL_ERROR, released exactly the
public bytes, and then answered a PING on the same connection.
The second command adds the amplifier. Success means the connection closed
while the client was still uploading; confirm the worker death from NGINX's own
log (worker process N exited on signal 11). A disconnect alone is not proof.
poc/exploit.py — command executionpoc/native/h2blast --version
python poc/exploit.py --target https://127.0.0.1:19443/ \
--profile nginx-1.31.8-debian13-amd64 \
--cmd 'touch /tmp/cve-2026-123007-proof'
The only valid success oracle is external: check that the marker exists inside the target's filesystem, owned by the worker's UID. The client's exit status and log line are not sufficient.
python3 -m venv poc/.venv
poc/.venv/bin/pip install -r poc/requirements.txt
cc -O2 -Wall -Wextra -Werror poc/native/h2blast.c -lcrypto -o poc/native/h2blast
python -m unittest discover -s poc/tests -t poc -v
The native helper and the RCE client require a POSIX host. The trigger requires
only Python and cryptography; the lab target requires Linux, Docker, and a
CPU with avx512f + avx512vl.
The RCE path assumes: direct TCP/TLS reachability (no TLS terminator or
buffering proxy), one backend for all sockets, auxiliary connections that land
on the same worker, a fresh worker heap, avx512f/avx512vl, glibc's
selected memcpy, and a session that finishes inside the configured keepalive,
send, and header timeouts. Failures are expected after substantial prior
traffic, across load balancers, or on paths too slow to complete a ~1 GiB
owner interval within 60 seconds.
Original vulnerability research, disclosure, and first public reproduction: Rapid7. This repository re-implements the clients and analysis and reuses the published calibration data for the two NGINX builds it names.