CRITICALVulnerability
Global
CVE-2026-123007: Critical NGINX HTTP/2 Integer Underflow Leads to RCE (FIXED)
·Source: Rapid7
Updated:
Executive Summary
Overview Today, both Rapid7 and F5 are disclosing CVE-2026-123007 , a critical integer underflow vulnerability affecting nginx HTTP/2, which can allow for unauthenticated remote code execution (RCE) against affected servers under certain conditions. CVE ID Description CWE CVSSv4 CVE-2026-123007 HTTP/2 flow-control memory corruption permitting worker-context RCE CWE-191 (Integer Underflow) 9.2 (Cri
Analysis
Overview Today, both Rapid7 and F5 are disclosing CVE-2026-123007 , a critical integer underflow vulnerability affecting nginx HTTP/2, which can allow for unauthenticated remote code execution (RCE) against affected servers under certain conditions. CVE ID Description CWE CVSSv4 CVE-2026-123007 HTTP/2 flow-control memory corruption permitting worker-context RCE CWE-191 (Integer Underflow) 9.2 (Critical) nginx can miscalculate how much response data an HTTP/2 client has allowed it to send. A remote, unauthenticated client can exploit this error by cancelling queued response data, then make nginx use an invalid length when copying a later response. The resulting memory corruption can disclose data, interrupt service, and execute code with the nginx worker process's permissions. Impact Rapid7 has developed a proof-of-concept to demonstrate leveraging CVE-2026-123007 for unauthenticated RCE against a vulnerable linux/amd64 Docker image running nginx version 1.31.8 , as shown below in Figure 1. The target nginx server’s configuration had http2 on and TLS enabled. Note that for brevity, video playback is at 8x speed. Figure 1: Video demonstrating unauthenticated RCE against NGINX 1.31.8 via CVE-2026-123007 Leveraging CVE-2026-123007 for RCE requires a significant amount of network traffic to be transmitted, approximately 128 GB of HTTP/2 data. Both available network bandwidth and connection timeouts will place practical limitations on Internet exploitation. In the above example shown in Figure 1, exploitation takes two and a half minutes. The approximate timings to transmit the required network data over a 10 Gbit/s network is two minutes, while on a 1 Gbit/s network it is seventeen minutes. Due to nginx’s default one hour connection lifetime, a network slower than approximately 300 Mbit/s will take over the one hour connection limit threshold and will not be able to succeed. Additionally, should an HTTP/2 connection be proxied, the precise attacker-controlled HTTP/2 frames being transmitted will likely not be retransmitted in a way that satisfies exploiting the vulnerability. Finally, the exploitation strategy developed depends on a specific x86-64 glibc EVEX/YMM memcpy implementation selected at runtime, based on the avx512f and avx512vl CPU features. Alternative RCE exploitation strategies may be viable, but none are currently known. Credit This vulnerability was discovered by Stephen Fewer, Senior Principal Security Researcher at Rapid7 , and is being disclosed in accordance with Rapid7's vulnerability disclosure policy . Technical analysis The version of nginx tested was a linux/amd64 Docker image for nginx version 1.31.8 ( nginx@sha256:5ab5b0b01097420873a3f3330f44248e34a3c2a3e8d5ee30658aeae8cb7435da ), and ran with an exposed HTTPS service and http2 enabled. How a client controls HTTP/2 response data HTTP/2 carries messages called frames over a connection. Each request and response belongs to a numbered stream, so one connection can carry several exchanges at once. Response-body bytes are carried in DATA frames. For this vulnerability, nginx is the sender and the remote client is the receiver. The client grants nginx permission, or flow-control credit, to send a certain number of DATA bytes. nginx tracks the remaining credit in two counters: one for each stream and one shared by the connection. Sending DATA must be permitted by both counters. These HTTP/2 counters are separate from TCP's receive window. The client grants more credit by sending a WINDOW_UPDATE frame containing a positive increment. A stream identifier of zero increases the connection’s send credit. A nonzero stream identifier increases the send credit for the stream with that specific nonzero identifier. HTTP/2 limits the increment and the resulting window to 2^31-1 bytes, or 2,147,483,647 (0x7FFFFFFF). This report calls that maximum MAX . The client can also send a SETTINGS frame containing a SETTINGS_INITIAL_WINDOW_SIZE parameter. This changes the starting credit for new streams. nginx must also adjust each active stream's remaining credit by the difference between the old and new setting values. It does not change the connection's credit. A reduction can therefore leave an active stream with negative credit until the client grants more. The connection window has no equivalent reduction: it must remain between zero and MAX . RFC 9113, section 6.9 defines these limits and the required errors. nginx stores the connection counter in h2c->send_window , where h2c is the HTTP/2 connection record. Its size_t type is an unsigned integer: on the verified 64-bit build it can hold values from zero to 2^64-1 . The size_t type can therefore hold values above HTTP/2's maximum connection window of 2^31-1 bytes ( MAX ). nginx must enforce that protocol limit in its own logic. // src/http/v2/ngx_http_v2.h #define NGX_HTTP_V2_MAX_WINDOW ((1U send_window , is explicitly declared as ssize_t , a signed 64-bit integer on the verified build. That allows SETTINGS_INITIAL_WINDOW_SIZE to make a stream's credit temporarily negative. The connection counter remains unsigned. The later unsafe conversion occurs when the output filter treats excessive connection credit as a signed 64-bit off_t response length. Leveraging vulnerability has four main stages: By slowing its reading of server output, the client keeps selected DATA frames queued and unstarted. It raises the connection's credit to MAX and the selected streams' credit to just below MAX . A SETTINGS frame that increases SETTINGS_INITIAL_WINDOW_SIZE enough to exceed the stream limit makes nginx close those streams while leaving the connection usable. Request cleanup then restores the reserved credit above MAX . An unsigned subtraction in the next connection WINDOW_UPDATE check underflows. Repeated accepted WINDOW_UPDATE frames can then raise the counter into the upper half of its 64-bit range without requiring the addition to wrap. On the verified 64-bit build, nginx interprets that excessive counter as a negative response length and creates an invalid buffer. Buffered TLS output then passes a huge unsigned byte count to the memory-copy function memcpy , causing out-of-bounds reads and writes. These constrained memory accesses depend on the build and selected copy routine. With a suitable memory layout, an attacker can use disclosed addresses and controlled overwrites to execute code with the nginx worker process's permissions. Cancelling queued DATA restores too much credit When nginx queues a DATA frame at [3], it subtracts the frame's DATA length from the connection's credit counter at [4] and then from the stream's credit counter. This reserves the credit before the bytes reach the client and prevents other streams from spending the same connection credit: // src/http/v2/ngx_http_v2_filter_module.c // ngx_http_v2_send_chain() // ... ngx_http_v2_queue_frame(h2c, frame); // send_window -= frame_size; // send_window -= frame_size; stream->queued++; An attacker can keep a later response queued by slowing or stopping its reading of earlier server output. Once the transport cannot accept more output, nginx must wait. This condition is transport backpressure. The attacker needs enough of it to keep the selected DATA frame unstarted: none of that frame's bytes have yet entered TLS output or the socket. Stopping response reads does not prevent the client from sending control frames in the other direction. While the DATA remains queued, the client sends a connection WINDOW_UPDATE that raises nginx's reduced counter to MAX . The problem appears when the request that owns the queued DATA then closes. Its request-cleanup handler removes the unstarted DATA and returns the reserved credit: // src/http/v2/ngx_http_v2_filter_module.c // ngx_http_v2_filter_cleanup() // ... for ( ;; ) { frame = *fn; if (frame == NULL) { break; } if (frame->stream == stream && !frame->blocked) { // next; window += frame->length; // queued == 0) { break; } continue; } fn = &frame->next; } // ... h2c->send_window += window; // 0 && stream->send_window > (ssize_t) (NGX_HTTP_V2_MAX_WINDOW - delta)) { if (ngx_http_v2_terminate_stream(h2c, stream, NGX_HTTP_V2_FLOW_CTRL_ERROR) == NGX_ERROR) { return NGX_ERROR; } continue; // NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) { // send_window += window; // (off_t) h2c->send_window) { limit = h2c->send_window; // stream->send_window) { limit = (stream->send_window > 0) ? stream->send_window : 0; } // ... if ((off_t) frame_size > limit) { frame_size = (size_t) limit; // = size) { // buf, offset, rest); // pos += offset; chunk->last = chunk->pos + size; // buf->last - in->buf->pos; // buf->end - buf->last) { size = buf->end - buf->last; } if (send + size > limit) { size = (ssize_t) (limit - send); } // ... ngx_memcpy(buf->last, in->buf->pos, size); // last += size; in->buf->pos += size; Both checks only reduce lengths that are too large. Neither rejects a negative length. memcpy takes an unsigned size_t byte count, so [17] converts -d back into the huge value 2^64-d . The actual source and destination buffers are far smaller. This is where the invalid connection credit first reaches an out-of-bounds native memory access. A copy that actually traversed such an enormous range would normally encounter inaccessible memory and crash the worker. In the tested x86-64 glibc implementation, however, certain lengths just below 2^64 cause the machine-level end-address calculations to wrap (Please see Addendum A below for more details on this unexpected behavior ). For a length of 2^64-d , adding the length to a start address can produce an address d bytes before it. The optimized copy uses these end addresses in its loop conditions, so it can finish after a limited number of reads and writes that reach outside the intended buffers. The copy can return if all locations it actually accesses are accessible; other lengths, memory layouts, or copy implementations can fault immediately. If it returns, nginx also moves both buffer positions backward by the negative signed length. Exploitation The invalid copy can both read and overwrite worker memory. It does not give the client an HTTP/2 field in which it can simply choose any memory address. The useful addresses depend on where nginx allocated the response and TLS buffers, how much output is already buffered, and which copy routine the C library selected. These are constrained read and write capabilities, not an unconditional arbitrary read or write. After creating the invalid DATA buffer, ngx_http_v2_send_chain() updates its position in the original response and records the bytes that remain to be sent: // src/http/v2/ngx_http_v2_filter_module.c // ngx_http_v2_send_chain() // ... offset += rest; // buf, offset, size); // buf = cl->buf; // ... } Here, offset is the position within the original body and size is its remaining length. Starting at offset zero, the same unsigned value representing -d makes [18] move the offset backward by d and increase the remaining length by d on the verified build. The shadow buffer created at [19] therefore has a positive length, but starts d bytes before the original response and ends at its original end. If the oversized copy and connection survive, later ordinary DATA frames can carry those preceding bytes to the client through TLS. They can include pointers into the heap, where nginx dynamically allocates request data, or into loaded libraries. Those pointers disclose addresses that address-space layout randomization (ASLR) would otherwise hide. On the write side, nginx stores client-supplied request data in heap allocations. With a suitable allocation layout, the oversized copy can pick up those attacker-selected bytes and replace fields in a nearby live heap object. One useful field is a callback: a stored function pointer that nginx intends to call later. An attacker who knows the relevant process addresses and can overwrite that field may redirect normal nginx processing to existing executable code. The overwrite need not contain new machine code. This explains the general route from disclosed addresses and controlled bytes to code execution; it does not claim that every build exposes the same object or callback. Execution has the worker's permissions; execution as the master process or root has not been established. The proof-of-concept first recovers heap addresses and pointers into nginx and the GNU C Library (glibc) from memory preceding the original response body. It uses those addresses and the overwrite to forge nginx request and response-buffer objects that return selected parts of glibc's loaded image over HTTP/2. The returned ELF metadata is parsed to resolve system() despite ASLR, then a request-pool cleanup callback is redirected to invoke an attacker-chosen command. Addendum A: Why an oversized memcpy can return The TLS copy via ngx_memcpy (shown at [17] above) receives a byte count of 2^64-d , where d is a small positive distance. A routine that actually traversed that entire range would normally fault. This addendum explains why one optimized glibc implementation can instead finish after a limited number of out-of-bounds accesses. glibc chooses among optimized copy routines according to the CPU's capabilities. The tested x86-64 routine uses EVEX/YMM instructions, which can move 32 bytes at a time. In the corresponding glibc 2.41 source, the EVEX wrapper includes a shared memcpy / memmove implementation, and its vector configuration sets VEC_SIZE to 32. A vector is the block of bytes handled by one such instruction. The following excerpt uses AT&T assembly syntax, in which the source operand comes first. The CPU register %rdi holds the original destination address, called D below; %rsi holds the source address, Q ; and %rdx holds the byte count, n . One route enters this backward-copy branch when D and Q are different and the unsigned difference D-Q is smaller than n . This includes the ordinary case where D is above Q and n is close to the unsigned 64-bit maximum. // glibc 2.41: sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S // Function: CPU-selected memcpy implementation, backward-copy branch // ... L(more_8x_vec_backward): // ... leaq (VEC_SIZE * -4 + -1)(%rdi, %rdx), %rcx // <--- [20] // ... andq $-(VEC_SIZE), %rcx // <--- [21] // ... L(loop_4x_vec_backward): // ... load and store four 32-byte vectors addq $(VEC_SIZE * -4), %rcx // <--- [22] cmpq %rcx, %rdi // <--- [23] jb L(loop_4x_vec_backward) // ... store the previously loaded leading and trailing vectors VZEROUPPER_RETURN // <--- [24] The full glibc assembly source shows the omitted loads and stores. At [20], leaq calculates an address without reading memory. Its 64-bit result keeps only the low 64 bits. At [21], andq rounds that address down to a 32-byte boundary. Calling the resulting destination address cursor , the calculation is: cursor = align_down_32((D + n - 129) modulo 2^64) = align_down_32(D - d - 129), when n = 2^64-d Here, align_down_32 means rounding down to the nearest address divisible by 32; it is explanatory notation, not a glibc function. For an ordinary heap address and a small d , the calculated cursor is already below D . The loop starts by copying one 128-byte block. Instruction [22] then moves the cursor backward by another 128 bytes. The comparison and unsigned jump at [23] repeat the loop only while D < cursor . Because the cursor is already below D , the jump is not taken. The routine writes its remaining leading and trailing vectors, then returns at [24]. It has not copied the enormous requested range: the wrapped address has made the loop stop after a small set of accesses. Those accesses can still read and overwrite memory outside the actual buffers. Remediation The following vendor supplied fixes are available. Product Vulnerable Versions Fixed Version 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 None NGINX Open Source 1.31.0 - 1.31.8 1.31.9 NGINX Open Source 1.9.5 - 1.30.6 1.30.7 For the latest remediation information, please see the vendor advisory . Disclosure timeline November 11, 2026: Rapid7 makes initial outreach to F5. November 12, 2026: F5 confirms outreach and Rapid7 discloses the vulnerability. F5 confirms receipt of the disclosure. November 16, 2026: F5 confirms validation of the vulnerability, CVE assignment, and a disclosure date of November 18, 2026. November 18, 2026: This disclosure.