
Bash scripts that check nginx hosts for NGINX2Root exposure: external surface scan for version, HTTP/2, HTTP/3 and mail ports, plus read-only on-host config check, with a Docker lab.
Two small, dependency-light Bash scripts to check whether an nginx host is exposed to NGINX2Root — the set of five vulnerabilities fixed in the nginx security release of 18 November 2026 (stable 1.30.7, mainline 1.31.9).
nginx2root-surface.sh — external, non-exploitative. Run it from anywhere
against a host you are authorised to test. It reports what attack surface is
visible from outside (version header, HTTP/2, HTTP/3, mail ports).nginx2root-check.sh — local, read-only. Run it on the host. It reads
the installed binary version and the active config to tell you which CVEs your
build and configuration are actually exposed to.Neither script sends exploit traffic or tries to trigger any bug. They report surface and configuration, not confirmed exploitability.
⚠️ Authorised use only. Run these only against systems you own or have explicit written permission to test. Port scanning and probing third-party hosts without authorisation may be illegal in your jurisdiction.
| CVE | Component | First affected | Severity (nginx) | Mitigated by disabling HTTP/2? |
|---|---|---|---|---|
| CVE-2026-123007 | HTTP/2 flow-control memory corruption (RCE) | 1.9.5 | major | ✅ yes |
| CVE-2026-123633 | HTTP/2 use-after-free to upstream | 1.19.7 | medium | ✅ yes |
| CVE-2026-121810 | HTTP/3 (QUIC) use-after-free, proxied | 1.25.0 | medium | ❌ no |
| CVE-2026-123634 | resolver use-after-free (resolver + variable proxy_pass + mirror) | 0.6.18 | medium | ❌ no |
| CVE-2026-113425 | mail-proxy use-after-free (auth_http) | 0.5.33 | major | ❌ no |
Fixed in: nginx 1.30.7 (stable) and 1.31.9 (mainline). Distro packages may carry a backport at a different version string — check your package changelog.
Because the mail-proxy and resolver bugs reach back to very old releases, effectively every build before the fix is affected by something. Treat any unpatched nginx as vulnerable and upgrade.
bash, curl, grep, sort (standard on Linux/macOS)openssl (optional, improves HTTP/2 ALPN detection in the surface scan)nginx -v and nginx -T; run it with sudo so it can read
the full merged config.chmod +x nginx2root-surface.sh
./nginx2root-surface.sh example.com
./nginx2root-surface.sh example.com example.org:8443
Example output:
== example.com:443 ==
Server: nginx/1.31.8
[EXPOSED] nginx 1.31.8 predates the NGINX2Root fix. Fixed: 1.30.7 (stable) / 1.31.9 (mainline).
[EXPOSED] HTTP/2 negotiated (ALPN h2) -> CVE-2026-123007 (core RCE) surface; -123633 if it proxies upstream.
[ OK ] No HTTP/3 (h3) advertised in Alt-Svc (may still be enabled without advertising).
[ OK ] No common mail-proxy ports reachable.
chmod +x nginx2root-check.sh
sudo ./nginx2root-check.sh
# or point it at a specific binary:
sudo ./nginx2root-check.sh /usr/local/nginx/sbin/nginx
[EXPOSED] / [VULNERABLE] — the condition for that CVE's attack surface is
present. For the surface scan this means visible from outside, not proven
exploitable.[WARN] — a partial match worth a manual look (e.g. mail ports are open, but
the scanner can't tell from outside whether nginx is the mail proxy behind them).[?] — the check couldn't run (version hidden by server_tokens off, a
fronting CDN/proxy, or missing openssl). Confirm on the host.[ OK ] — that specific surface/condition was not found.A fronting CDN or reverse proxy can hide the real origin version and still answer on HTTP/2 — the surface scan sees the edge, not necessarily your nginx. Always confirm with the host check.
lab/ contains a Docker lab that verifies the scanner against the real
nginx images released on 18 Nov 2026 — a vulnerable 1.31.8 next to the patched
1.31.9 — plus a Docker-free unit test of the fix boundary:
cd lab
./run-lab-test.sh # version matrix + surface scan + on-host check, with asserts
It is a detection lab: stock official images, no exploit code, no exploit traffic. See lab/README.md.
reload reuses the running binary and does not swap in
the patched one.http2 on; off (or remove the http2 listen flag) → blocks CVE-2026-123007
and CVE-2026-123633 only.http3 off; / remove quic listeners → reduces CVE-2026-121810.resolver +
variable proxy_pass + mirror usage.These scripts have only been tested against the Docker lab in this repository, not against production systems. Use them at your own risk. They are provided "as is", without any warranty; the author accepts no liability for any damage or consequences resulting from their use. Only run them against systems you own or are explicitly authorised to test.
MIT — see LICENSE.