← Blog

NGINX2Root: Pre-Auth RCE in NGINX HTTP/2 (CVE-2026-123007)

Share on X

November 18, 2026: Two memory-safety bugs in NGINX's HTTP/2 code let an attacker run code on the web server without logging in. CVE-2026-123007 is an integer underflow in HTTP/2 flow control, present since nginx 1.9.5 in 2015. CVE-2026-123633 is a use-after-free when an HTTP/2 connection is drained, present since 1.19.7. Both are fixed in nginx 1.30.7 (stable) and 1.31.9 (mainline), and both need HTTP/2 to be switched on, which it is on most HTTPS sites.

Five teams found the bugs independently: Wiz Research, Xint, Rapid7, Ikotas Labs and Metnir. Wiz's write-up says it got code execution on a server doing nothing more than serving static files, with no backend application and no third-party module. Rapid7 has already published a working exploit for CVE-2026-123007. This lands one day after Java4Shell, so many teams now have two pre-auth RCEs to patch in the same week.

What did researchers find in NGINX?

The two HTTP/2 bugs are the headline, and Wiz and Rapid7 both score them 9.2 on CVSS 4.0. Xint groups them with three more nginx bugs under the name NGINX2Root. All five are fixed in the same release:

  • CVE-2026-123007: HTTP/2 flow-control integer underflow. Needs only HTTP/2. Affects 1.9.5 to 1.31.8.
  • CVE-2026-123633: HTTP/2 connection use-after-free. Needs HTTP/2 plus proxying to an upstream. Affects 1.19.7 to 1.31.8.
  • CVE-2026-123634: use-after-free in the DNS resolver, reached through resolver, a request-derived proxy_pass and subrequests such as mirror.
  • CVE-2026-121810: use-after-free in HTTP/3 (QUIC) when proxying upstream. Affects 1.25.0 and later.
  • CVE-2026-113425: use-after-free in the mail proxy's auth_http path.

Each of these gives code execution as the nginx worker user, usually www-data or nginx. Xint says it then chained a Linux kernel SCTP bug, present since kernel 4.15, to get root on the host, including from inside a Docker container. That kernel bug has no CVE or patch yet, and Xint is holding back its details.

The nginx.org advisory page rates CVE-2026-123007 as major and CVE-2026-123633 as medium. The researchers rate both critical because they have working exploits. Go by the exploits.

How does the HTTP/2 flow-control bug work?

HTTP/2 limits how much data a server may send before the client asks for more. nginx tracks that allowance for each connection in h2c->send_window. The protocol caps it at 231-1, but nginx stores it as an unsigned size_t and does not enforce the cap everywhere. Rapid7's analysis walks through the chain:

  1. Unchecked refund. When a stream is cancelled with queued response data, ngx_http_v2_filter_cleanup() adds the unsent bytes back to send_window without checking the maximum. If the client has already raised the window with WINDOW_UPDATE frames, the counter goes past 231-1.
  2. The limit check wraps. The WINDOW_UPDATE handler subtracts send_window from the maximum to see how much more credit is allowed. Once the counter is above the maximum, that subtraction wraps to a huge unsigned number, so every later increase passes.
  3. A negative length. ngx_http_v2_send_chain() converts the oversized counter to a signed off_t, where it becomes negative. The send buffer it builds ends before it starts.
  4. Out-of-bounds copy. On the TLS send path, ngx_ssl_send_chain() turns that negative length back into an unsigned size and hands it to memcpy. That reads and writes outside the buffer.

This is the check that fails:

if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) {
    /* FLOW_CONTROL_ERROR */
}

Rapid7 also found that a SETTINGS change pushing a stream window past the limit only resets that stream, where RFC 9113 says to kill the whole connection. That keeps the attacker's connection alive while the counter is pushed into place.

How does the use-after-free work?

CVE-2026-123633 is about connection reuse. When an HTTP/2 connection has no active streams, nginx puts it on a list of connections it may close if it runs short of free slots. Starting a new stream in ngx_http_v2_create_stream() does not take it off that list.

Wiz describes the trigger: a client opens a stream and starts a HEADERS frame without finishing it, while nginx opens an upstream connection. If slots are low, ngx_drain_connections() picks the still-busy HTTP/2 connection. nginx tries to send a GOAWAY frame, and if that fails the error path frees the connection's memory. The request is still running and keeps using the freed memory. An attacker who refills that memory with their own data can steer the stale pointers. Because it needs nginx to open an upstream connection, it mostly affects reverse proxies.

How hard is it to exploit?

Harder than a one-request bug, but practical. Rapid7's public exploit for CVE-2026-123007 targets the official nginx 1.31.8 Docker image with HTTP/2 over TLS. It:

  • reads heap, nginx and glibc pointers from memory just before a response body, which defeats ASLR;
  • builds fake buffer objects to leak glibc and find system();
  • overwrites a request cleanup callback, so nginx calls attacker-chosen code.

The catch is volume. The attack needs about 128 GB of HTTP/2 traffic: about two minutes at 10 Gbit/s and 17 minutes at 1 Gbit/s. A connection lasts at most an hour by default, so links slower than about 300 Mbit/s probably can't finish it. The exploit also relies on the AVX-512 version of glibc's memcpy, used on most recent Intel and AMD servers. A CDN or WAF that ends HTTP/2 and opens a new connection to your origin will likely break the attack, because frames are not passed through as sent.

Wiz confirmed code execution with an ASLR bypass on official 1.31.7 and 1.31.8 builds. Neither Wiz nor Xint is releasing its exploits. No attacks in the wild had been reported as of November 18.

What does the fix change?

The flow-control fix adds a send_queued counter to the connection, so nginx tracks bytes it has queued but not yet sent separately from the window. The WINDOW_UPDATE check then counts both:

if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window - h2c->send_queued) {

Queueing, sending and stream cleanup each update the two counters, so a cancelled stream can no longer push the window past the limit. The patched build logs "client violated connection flow control" when a client tries it.

Which versions are affected and fixed?

  • nginx open source: 1.9.5 to 1.30.6 and 1.31.0 to 1.31.8 are affected. Upgrade to 1.30.7 or 1.31.9.
  • NGINX Plus: fixed in 37.0.8.1 and 37.3.0.1. R34 to R36 have no fix listed, so F5 customers on those need to move to 37.x.
  • Linux distributions: Ubuntu, Debian, RHEL and Alpine keep older version numbers and backport fixes, so nginx -v won't tell you if you are patched. Check the package changelog for the CVE numbers. On November 18, most distribution packages and the official nginx:stable and nginx:mainline Docker images were still waiting for the fix.

Ingress controllers, API gateways and appliances that embed nginx need their own vendor update. These are the packaged products Wiz expects attackers to go after first, because every customer runs the same build.

How do you protect NGINX before you can patch?

  1. Find where HTTP/2 is on. Run nginx -T | grep -nE "listen.*http2|http2 on" on each host.
  2. Turn it off if you can't patch today. On 1.25.1 and later, set http2 off; and remove http2 from listen lines. On older versions, removing it from listen is the only switch. This blocks both HTTP/2 CVEs, but gRPC and other HTTP/2-only clients will stop working.
  3. Cover the other three bugs. Point proxy_pass at fixed upstreams instead of request-time DNS, remove quic listeners if you don't need HTTP/3, and keep mail proxy ports off the internet.
  4. Restart, don't reload. nginx -s reload keeps the old binary running. Use systemctl restart nginx after upgrading and confirm the start time changed.
  5. Disable SCTP if you don't use it. Add install sctp /bin/false to a file in /etc/modprobe.d/. This blocks the root step Xint describes, but only if the module isn't already loaded or built in.

What signs of attack should you look for?

HTTP/2 control frames don't show up in access logs, so an attack can look quiet there. CIRCL's advisory and the researchers suggest checking:

  • long-lived HTTP/2 connections receiving huge amounts of data while logging very few requests;
  • "worker process exited on signal 11" or segfault lines in the nginx error log, and new core dumps (coredumpctl list nginx);
  • nginx worker processes starting shells or other programs, which execve auditing will catch;
  • new outbound connections or DNS lookups from the web server.

Why does this one matter?

nginx sits in front of a large share of the internet, often in front of other software. Xint counted 56.7 million nginx hosts on Shodan, and 98.9% of the ones showing a version were in the affected range. That overstates real exposure, since HTTP/2 must be on and many distributions backport fixes. But it shows how far back these bugs go. A web server bug runs before any application code, so a well-written app behind nginx offers no protection. Like Php2Shell and Java4Shell before it, this was found by AI-assisted code review. More of these old platform bugs are likely to turn up, so plan for faster patch cycles on your web servers.