Skip to content
Memory corruption Write-up Advanced

CVE-2026-123007: Critical NGINX HTTP/2 Integer Underflow Leads to RCE (FIXED)

nginx miscalculates HTTP/2 flow-control credit, allowing an unauthenticated client to drive the connection send window above the protocol maximum and trigger an integer underflow. The resulting memory corruption can disclose data, interrupt service, and execute code with the nginx worker's permissions.

Stephen Fewer Follow

Published on rapid7.com

DISCOVER RAPID7 MDR

Rapid7, on rapid7.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the connection send-window counter is an unsigned size_t that is restored without checking the HTTP/2 maximum, so a later subtraction underflows and the oversized value is cast to a signed response length.

Impact

An unauthenticated attacker could achieve remote code execution with the worker's permissions, but this requires roughly 128 GB of traffic, a fast connection, no proxying, and a specific glibc memcpy implementation.

What the attacker needed

Http2 enabled with TLS; no HTTP/2 proxy in front; roughly 128 GB of traffic; connection faster than about 300 Mbit/s

The fix

nginx should enforce the HTTP/2 maximum on the connection send window after restoring credit and reject the SETTINGS condition with a connection error as RFC 9113 requires.

How it was found

  1. Slow or stop reading server output so selected DATA frames stay queued and unstarted.
  2. Raise the connection credit to the maximum and the selected streams' credit to just below it.
  3. Send a SETTINGS frame that increases the initial window size so nginx closes those streams but keeps the connection open.
  4. Send further connection WINDOW_UPDATE frames to push the counter into the upper half of its 64-bit range.
  5. Let an active stream process a response body so the excessive credit becomes a negative length and an invalid buffer.
  6. Trigger buffered TLS output so the oversized copy reads and writes outside the buffers.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

HTTP/2 lets a client tell the server how many bytes it is willing to receive, using a number called flow-control credit. nginx tracked that number in a way that could be pushed past its allowed maximum, and a later subtraction then wrapped around to a huge value. That huge value was treated as a response length, so a memory copy read and wrote far outside the intended buffers.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.