Drainbreak (CVE-2026-123633, CVSS 4.0: 9.2) is a use-after-free in NGINX that allows an unauthenticated client to execute code on an HTTP/2 reverse proxy. 1 We exploited it by sending valid HTTP/2 traffic to a proxied route.
On August 29, 2026, Metnir's pipeline found the bug during a scan using our harness and generally available models. We then developed an exploit that executed native code with ASLR enabled, and a separate chain that ran commands as the unprivileged nginx user.
The screenshot shows command execution against a disposable VM in our lab. Its configuration is included below.
Tests against older releases found related failures back to NGINX 1.9.5, which introduced HTTP/2 in 2015.
Update to 1.31.9, or 1.30.7 on the stable branch, or install your vendor's patched build. Until then, disable client-facing HTTP/2 .
Each NGINX worker has a fixed number of connection slots, set by worker_connections and shared by client and backend sockets. 2 Idle connections go on reusable_connections_queue so NGINX can close them when it needs space. Before allocating a slot, ngx_get_connection() calls the drain, which starts reclaiming connections when no more than one sixteenth of the slots are free.
The drain sets c->close and calls the selected connection's read handler synchronously. If a proxied request needs a backend connection, the drain runs inside that request's connect call. A request on a connection still marked reusable can therefore cause its own read handler to run again.
Incomplete HTTP/2 frames
ngx_http_v2_handle_connection() runs when the last HTTP/2 stream finishes. It marks the connection reusable before checking whether the parser holds an incomplete frame.
TCP can split a frame across reads. For a fully idle connection, NGINX installs ngx_http_v2_idle_handler() , which removes the connection from the queue when more data arrives. A partial frame causes the function to return early and keep ngx_http_v2_read_handler() so parsing can resume. That handler leaves the reusable flag set.
The remaining bytes can then complete a HEADERS frame and start a proxied request. If the worker is short of slots when the request asks for a backend connection, the drain can select the request's own connection and re-enter its read handler.
The early return was added in commit 76672e65 , “HTTP/2: reuse of connections with incomplete frames”, released in NGINX 1.19.7 in February 2021. The change allowed NGINX to reclaim connections that clients had left stalled on partial frames.
Freeing the request during upstream setup
In the first trace, the drain called ngx_http_v2_read_handler() on the request's own connection. The handler sent GOAWAY and let the active stream finish, so the request completed normally.
When the GOAWAY write fails because the client has disconnected, the handler calls ngx_http_v2_finalize_connection() . This closes the connection's streams and destroys their request pools. For a proxied request, the pool contains the request r , the upstream state u , and the peer descriptor pc inside u .
The outer call to ngx_event_connect_peer() still holds pc . With a slot now available, ngx_get_connection() returns successfully. Upstream setup then reads pc->rcvbuf from the freed pool.
AddressSanitizer caught this read on unmodified NGINX 1.31.4.
Frame #16 in the read stack is the outer HTTP/2 handler. Frame #9 in the free stack is the same handler, called from the drain. Both execute on thread T0.
We reproduced it. Keeping the client connected or delivering the frame in a single piece, allowed the request to finish under that same connection pressure.
Earlier NGINX releases
The split-frame test under connection exhaustion also failed on NGINX 1.9.5. By 1.9.6, it reached the same read in ngx_event_connect_peer() . NGINX 1.19.6 reached that read through a different path. A cleartext connection marked reusable by HTTP/1.x could switch to HTTP/2 while keeping that state.
NGINX fixed the cleartext path in commit 797a2dc7 , “HTTP/2: fixed reusing connections with active requests”. It was committed five seconds after 76672e65 and shipped in the same 1.19.7 release. The fix explicitly marked connections non-reusable during the transition to HTTP/2.
Freed request-pool memory returns to the heap and can be reused by a later allocation of a similar size. If NGINX fills that allocation with bytes from the attacker's traffic, those bytes replace part of the old upstream object.
When the outer call resumes, it reads the replacement bytes as upstream state. That object contains callbacks used during cleanup. Overwriting a callback can redirect an indirect call to an attacker-chosen address.
Allocator reuse determines where the write lands, while the allocation's size and layout limit which bytes the attacker can control. 3
The run in the screenshot took ten minutes, nearly all of it spent on ASLR. The target ran a stock NGINX build behind HTTPS with this configuration.
We are withholding the exploit and the remaining ASLR steps while patched builds reach distributions and downstream products.
NGINX fixed the bug in commit 2df48a50 , “HTTP/2: reset reusable connection status on stream creation”.
ngx_http_v2_create_stream() now removes the connection from the reusable queue when a completed HEADERS frame becomes a stream. Connections holding partial frames remain reclaimable while they have no active streams.
Versions affected and mitigations
NGINX 1.19.7 through 1.31.8 are affected. The fix is in 1.31.9 and, on the stable branch, 1.30.7. 1 Update NGINX, or install your vendor's patched build for distribution packages and products built on NGINX. Distribution packages may include backported fixes under an older version number, so check the package advisory as well.
Our exploit uses proxy_pass . Other upstream modules, including grpc_pass and fastcgi_pass , the connection-allocation code and should be treated as exposed until the maintainers confirm otherwise.
We reproduced the use-after-free in OpenResty and crashed the shipped binaries of Kong, Apache APISIX, NGINX Gateway Fabric and community ingress-nginx. Those four products enable HTTP/2 by default. Community ingress-nginx was retired in March 2026 and no longer receives security fixes. 4 Disable HTTP/2 there and migrate to a maintained controller.
Restart NGINX after installing the patched executable. A configuration reload uses the running executable. On Linux, this command shows the master's binary; (deleted) means the file was replaced after that process started.
Recreate containers from the patched image.
If you can't update yet
Disable client-facing HTTP/2 on listeners that proxy requests. On NGINX and OpenResty, remove http2 from every listen directive on the affected address and port. On NGINX 1.25.1 or later, also set http2 off; . 5
For community ingress-nginx, set use-http2: "false" in the controller ConfigMap. For NGINX Gateway Fabric, set disableHTTP2: true in NginxProxy and check the generated listener configuration.
For Kong, remove the http2 flag from proxy_listen . For Apache APISIX, set apisix.enable_http2: false in config.yaml .
You can also terminate HTTP/2 at a front end that forwards HTTP/1.1 to NGINX, provided clients cannot reach NGINX directly. Run this from outside the deployment and check for 1.1 in the output.
Disabling HTTP/2 will break services that require it end to end, including gRPC. Patch those listeners first. HTTP/1.1 clients may also open more connections, so check that the workers have enough capacity after the change.
NGINX logs a warning when it drains connections, at most once per second. On an HTTP/2 proxy, repeated worker crashes after these warnings, or core dumps in ngx_event_connect_peer() , may indicate this bug.
We reported the vulnerability to F5 SIRT on September 12, 2026, with a reproducer and root-cause analysis. F5 confirmed the use-after-free on October 24 and agreed on a release date. The fixes are in NGINX 1.31.9 and 1.30.7.
Research and writeup by Albert Ebb (@SergioOSINT) of Metnir. We thank F5 SIRT and the NGINX engineers for investigating the report and coordinating the fix.
CVE-2026-123633 in the NGINX 1.31.9 changes . ↩ ↩ 2
CVE-2026-123633 in the NGINX 1.31.9 changes . ↩ ↩ 2
NGINX worker_connections documentation . ↩
NGINX worker_connections documentation . ↩
Data-only some-what-where . ↩
Data-only some-what-where . ↩
Kubernetes statement on ingress-nginx retirement . ↩
Kubernetes statement on ingress-nginx retirement . ↩
NGINX HTTP/2 module documentation . ↩
NGINX HTTP/2 module documentation . ↩
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
