Murat BekgiPenetration tester
Subscribe
Write-ups

NGINX2Root: find your HTTP/2 exposure and patch it properly

CVE-2026-123007 and CVE-2026-123633 let attackers corrupt NGINX memory over HTTP/2 without logging in. How to check, work around, patch and confirm.

Published
Reading time
5 min
Topic
Web and API
Contents
  1. The two HTTP/2 bugs
  2. The other eight
  3. Step 1: find out what you’re running
  4. Step 2: patch, then restart for real
  5. Step 3: the workaround if you can’t patch today
  6. Step 4: look for signs of trouble
  7. Exercise: practice the fix in a lab

November 15 to 21. On November 18, NGINX released 1.31.9 and 1.30.7 with fixes for ten vulnerabilities. Two of them are in the HTTP/2 code and can lead to remote code execution with no login (Wiz). Five teams found the HTTP/2 bugs independently: Wiz Research, Ikotas Labs, Metnir, Rapid7 and Xint (SecurityWeek). Xint calls its group of five critical bugs NGINX2Root.

Nobody has reported exploitation in the wild yet. A public proof of concept for CVE-2026-123007 exists, though, and Censys counted about 8.8 million exposed NGINX services in the affected range as of November 19 (BleepingComputer). This post is the defender’s version: what the bugs are, how to tell if you’re exposed, and how to fix it so the fix actually takes. Only test what you own or are authorized to test.

TODO(murat): add a line on where you run into NGINX with HTTP/2 on engagements, if you want one.

The two HTTP/2 bugs

Both are rated 9.2 under CVSS 4.0 (Wiz).

CVE-2026-123007 is an integer underflow in HTTP/2 flow control. NGINX keeps a send window for each connection. When a stream is canceled, NGINX refunds the queued bytes to the window without checking the protocol maximum. The bounds check on WINDOW_UPDATE frames uses unsigned math, so once the window is over the limit the check underflows and stops working. The counter eventually turns into a negative length on the TLS send path, and NGINX copies out of bounds. It affects 1.9.5 through 1.31.8. 1.9.5 is the release that added HTTP/2, so this bug is as old as the feature. It needs nothing beyond HTTP/2 on a listener the attacker can reach. A plain static site is enough.

CVE-2026-123633 is a use-after-free. An HTTP/2 connection with no active streams goes on NGINX’s list of reusable connections. If a request starts while a header frame is only partly received, the connection stays on that list. When worker connection slots run low, NGINX can close it. If building the GOAWAY frame fails on that path, NGINX frees the connection’s memory while the request is still using it. This one needs HTTP/2 and proxying to a backend. It affects 1.19.7 through 1.31.8.

Wiz demonstrated both on 64-bit systems over TLS and says both can leak memory to get past ASLR. F5’s advisory says code execution needs ASLR disabled or bypassed, and that a crashed worker is the likelier result otherwise (SecurityWeek). Plan as if Wiz is right. A worker crash loop is still an outage.

The code runs as the NGINX worker user, not root. Xint chained CVE-2026-123007 with an unpatched use-after-free in the Linux kernel’s SCTP code to get out of a Docker container and onto the host as root. Xint is holding the kernel details until a fix ships (LinuxShout).

The other eight

The same release fixed three more 9.2 bugs that need less common configs (Wiz, LinuxShout):

  • CVE-2026-121810, a use-after-free in HTTP/3 with proxying.
  • CVE-2026-123634, a use-after-free in the resolver when the upstream name is built from variables, or with SSI or mirror subrequests.
  • CVE-2026-113425, a use-after-free in the mail proxy with auth_http.

The remaining five are denial of service, a client certificate bypass in specific SNI setups, an ssl_preread validation issue and an alias plus try_files overflow. Upgrading fixes all ten, which is the main reason to upgrade instead of living on workarounds.

Step 1: find out what you’re running

On each host, get the version and the build options:

nginx -v
nginx -V 2>&1 | tr ' ' '\n' | grep -E 'http_v2|http_v3|mail'

Then dump the full running config and look for the features each bug needs:

sudo nginx -T 2>/dev/null | grep -nE 'http2|http3|quic|proxy_pass|grpc_pass|mirror|ssi on|auth_http|resolver'

listen 443 ssl http2; or http2 on; means CVE-2026-123007 applies. HTTP/2 plus proxy_pass or grpc_pass means CVE-2026-123633 applies too.

Version numbers lie on distro packages. Debian, Ubuntu and RHEL-family distros often backport fixes without changing the upstream version, so compare the full package version against your distro’s advisory (LinuxShout):

dpkg -l | grep -i nginx
rpm -qa | grep -i nginx

From the outside, this tells you whether a server you’re authorized to test negotiates HTTP/2:

curl -sk --http2 -o /dev/null -w '%{http_version}\n' https://your-server.example/

2 means HTTP/2 is on. 1.1 means it isn’t.

Step 2: patch, then restart for real

The fixed releases are NGINX 1.31.9 mainline and 1.30.7 stable. For NGINX Plus they’re 37.0.8.1 on the LTS track and 37.3.0.1 on the continuous release track (SecurityWeek).

The step people skip: nginx -s reload re-reads the config, but it does not swap the running binary. Xint makes this point, and F5’s community post says a reload alone isn’t proof the new code is running (F5 DevCentral). Do a full restart:

sudo systemctl restart nginx

Then confirm the master process started after the upgrade:

ps -o pid,lstart,cmd -C nginx

If the start time is older than the package install, the old code is still serving traffic.

Containers count too. Rebuild the image on a fixed base and redeploy, then check the image that’s actually running in the pods, not the one in the manifest. F5’s NGINX Ingress Controller moved to NGINX Plus 37.0.8.1 in its 2026-lts-r11 release (F5 DevCentral). Other NGINX-based ingress projects ship on their own schedule.

Step 3: the workaround if you can’t patch today

Turn HTTP/2 off. On NGINX 1.25.1 and newer, set http2 off; in each affected server block. On older versions, remove http2 from the listen lines (Wiz):

server {
    listen 443 ssl;
    http2 off;
    # ...
}

Check first whether anything behind that server needs HTTP/2. gRPC does. Then test and apply:

sudo nginx -t
sudo systemctl reload nginx

A reload is fine here because you’re changing config, not the binary. Rerun the curl check and expect 1.1. This covers only the two HTTP/2 bugs. For the others, Xint’s interim advice is http3 off and no quic listeners for CVE-2026-121810, firewalling the mail proxy for CVE-2026-113425, and turning off mirror or using a fixed upstream name for CVE-2026-123634 (LinuxShout). Raising worker_connections is not a fix (F5 DevCentral).

Until the kernel SCTP fix ships, Xint suggests stopping the module from loading. This does nothing if SCTP is built into the kernel or already loaded, so check with lsmod | grep sctp first:

echo 'install sctp /bin/false' | sudo tee /etc/modprobe.d/disable-sctp.conf

Step 4: look for signs of trouble

There’s no clean indicator for this one. NGINX access logs don’t record HTTP/2 control frames, so a quiet log proves nothing (F5 DevCentral). Wiz suggests watching for long-lived HTTP/2 connections that push unusually large amounts of data, unexpected worker crashes, and NGINX workers starting other processes (Wiz). Worker crashes show up in the error log:

sudo grep -E 'worker process [0-9]+ exited on signal' /var/log/nginx/error.log

A worker spawning a shell is never normal. If you have process telemetry, alert on any child of an NGINX worker. Patching doesn’t remove anything an attacker already left behind, and it doesn’t rotate credentials the worker could read.

Exercise: practice the fix in a lab

Run this on your own machine. It doesn’t exploit anything. It builds a vulnerable-version server, proves HTTP/2 is on, applies the workaround and proves it took.

Pick an official nginx image tag from Docker Hub that is 1.25.1 or newer, so http2 on; works, and older than 1.31.9. Put it in OLD_TAG. Then:

mkdir nginx-lab && cd nginx-lab
openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 7 -subj "/CN=localhost"
cat > default.conf <<'EOF'
server {
    listen 443 ssl;
    http2 on;
    ssl_certificate     /etc/nginx/certs/cert.pem;
    ssl_certificate_key /etc/nginx/certs/key.pem;
    location / { return 200 "lab\n"; }
}
EOF
docker run -d --name nginx-lab -p 8443:443 \
  -v "$PWD/default.conf:/etc/nginx/conf.d/default.conf:ro" \
  -v "$PWD:/etc/nginx/certs:ro" "nginx:${OLD_TAG}"
docker exec nginx-lab nginx -v
curl -sk --http2 -o /dev/null -w '%{http_version}\n' https://localhost:8443/

You should see the old version and 2. Now change http2 on; to http2 off; in default.conf, and reload:

docker exec nginx-lab nginx -t
docker exec nginx-lab nginx -s reload
curl -sk --http2 -o /dev/null -w '%{http_version}\n' https://localhost:8443/

Expect 1.1. Last, do the real fix. Remove the container, start a new one on a fixed tag with HTTP/2 back on, and check the version and protocol again.

Clean up with docker rm -f nginx-lab.


New write-ups and both weekly posts land in the inbox — subscribe, or grab the RSS feed.

Found this useful? It keeps the labs free and the posts coming.Buy me a coffee