Documentation

Nginx CVE-2026-123007 (NGINX2Root) HTTP/2 RCE: How to Patch and Mitigate

Patch nginx to 1.30.7 or 1.31.9 to fix CVE-2026-123007 and the other NGINX2Root flaws, with interim mitigations if you cannot upgrade yet.

A
Adam Birds
Published 1 December 20264 min read0 views

On 18 November 2026, nginx 1.30.7 (stable) and 1.31.9 (mainline) fixed ten CVEs. The most serious, CVE-2026-123007, is a memory-corruption bug in HTTP/2 flow control. An unauthenticated attacker can use it for remote code execution as the nginx worker user. It affects every release from 1.9.5 to 1.31.8.

Five of the flaws are rated CVSS 4.0 9.2 and are often grouped together as โ€œNGINX2Rootโ€. A public proof of concept exists for CVE-2026-123007. Patch internet-facing servers first.

Affected components

CVE Area Exposed when Affected
CVE-2026-123007 HTTP/2 flow control (integer underflow) HTTP/2 is enabled on any listener 1.9.5 โ€“ 1.31.8
CVE-2026-123633 HTTP/2 use-after-free HTTP/2 is enabled and nginx proxies to a backend 1.19.7 โ€“ 1.31.8
CVE-2026-121810 HTTP/3 (QUIC) use-after-free listen ... quic is used while nginx proxies 1.25.0 โ€“ 1.31.8
CVE-2026-123634 Resolver use-after-free proxy_pass uses a variable with resolver, plus a mirror or SSI subrequest 0.6.18 โ€“ 1.31.8
CVE-2026-113425 Mail proxy use-after-free the mail module is used with auth_http 0.5.33 โ€“ 1.31.8
CVE-2026-118899 TLS 1.3 request-body infinite loop (DoS) listen ... ssl with TLS 1.3 1.13.0 โ€“ 1.31.8
CVE-2026-125283 Buffer overflow alias is used together with try_files 0.9.6 โ€“ 1.31.8
CVE-2026-123640 stream ssl_preread validation the stream module uses ssl_preread 1.15.2 โ€“ 1.31.8
CVE-2026-120967 stream client certificate bypass ssl_verify_client on is set outside the default server 1.25.5 โ€“ 1.31.8
CVE-2026-120993 PROXY protocol v2 NULL dereference (DoS) PROXY protocol v2 is used in the stream module 1.31.4 โ€“ 1.31.8 (mainline only)

Branches 1.29 and older receive no upstream fix.

Check whether a server is exposed

Check the running version and the features in use:

nginx -v
sudo nginx -T 2>/dev/null | grep -nE 'http2|quic|http3|resolver|mirror|ssi on|auth_http|ssl_preread|ssl_verify_client|try_files|alias'

Distribution packages often backport fixes without changing the upstream version number, so nginx -v alone cannot tell you whether a distro build is fixed. Check the package version against your distributionโ€™s security advisory (USN, DSA, RHSA, ALSA, ALAS, and so on).

Fix: upgrade and restart

Debian or Ubuntu (nginx.org or distribution repository)

sudo apt update
sudo apt install --only-upgrade nginx
sudo systemctl restart nginx

RHEL, AlmaLinux, Rocky or Amazon Linux

sudo dnf upgrade nginx
sudo systemctl restart nginx

Alpine

sudo apk upgrade -U nginx
sudo rc-service nginx restart

Docker

Pin the fixed tags (nginx:1.30.7, nginx:1.31.9 or their -alpine variants), then rebuild any derived images so they pick up the new base:

docker pull nginx:1.30.7
docker build --pull -t <your-image>:<tag> .

Restart, do not reload

nginx -s reload and systemctl reload nginx keep the old master process, and therefore the old binary, running. A full restart is required. Afterwards, check that no process is still running a deleted (replaced) binary:

sudo ls -l /proc/[0-9]*/exe 2>/dev/null | grep -F 'nginx (deleted)'

No output means the new binary is in use.

NGINX Plus

The fixed builds are PLS.37.3.0.1 and PLS.37.0.8.1. Advisories disagree on whether R33 or only R34โ€“R36 is affected, and those releases have no fix listed. Move to a supported release and check F5โ€™s advisory for your branch.

Interim mitigations

These reduce exposure only until you can upgrade. None of them covers every CVE.

Disable HTTP/2 (CVE-2026-123007, CVE-2026-123633)

On nginx 1.25.1 and later, add this to each server block:

http2 off;

On older versions, remove http2 from the listen lines:

# before
listen 443 ssl http2;
# after
listen 443 ssl;

Clients fall back to HTTP/1.1. Re-enable HTTP/2 after upgrading.

Disable HTTP/3 (CVE-2026-121810)

Remove the listen ... quic lines and any Alt-Svc header that advertises h3.

Mail proxy (CVE-2026-113425)

Bind mail listeners to loopback or a trusted network, or block them at the firewall.

Resolver (CVE-2026-123634)

Point proxy_pass at a fixed upstream block instead of a variable, and avoid mirror and SSI in those locations.

There is no configuration workaround for the TLS 1.3 denial of service (CVE-2026-118899).

Verify

Confirm the version and that the service restarted cleanly:

nginx -v
sudo nginx -t && systemctl status nginx --no-pager

If HTTP/2 was disabled as a stopgap, confirm that it is no longer negotiated:

echo | openssl s_client -connect <your-domain>:443 -servername <your-domain> -alpn h2 2>/dev/null | grep -i alpn

No ALPN negotiated means HTTP/2 is off.

Look for signs of exploitation

Crashed workers can indicate exploitation attempts, although they also happen for other reasons:

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

nginx workers should never start child processes. List any that have:

for pid in $(pgrep -f 'nginx: worker'); do pgrep -a -P "$pid"; done

Also look for long-lived HTTP/2 connections that send a lot of inbound data but log very few requests.

Notes

  • 1.31.9 also starts rejecting header lines without a colon and some malformed chunked bodies. For the least change, use 1.30.7 (stable).
  • A CDN or load balancer that terminates HTTP/2 in front of nginx may block parts of the CVE-2026-123007 exploit, but it is not a substitute for patching.
  • Several distributions shipped partial backports first. Ubuntu, for example, initially left CVE-2026-125283 open. Re-check your distributionโ€™s tracker until every CVE above shows as fixed.
Last updated: 1 December 2026v1