20 min read

Write Your Own Nmap Vulnerability Script: Detecting nginx2root (CVE-2026-123007)

Upgrading is the fix. Until every server is done, this check shows which NGINX servers the two HTTP/2 flaws can reach, and which can wait.
Two NGINX 1.31.8 servers compared: with HTTP/2 on, the check reports LIKELY VULNERABLE; with HTTP/2 off, NOT VULNERABLE.
Lab cases 1 and 3: Nmap’s service detection reports both servers identically.

21 November 2026


F5 fixed two flaws in the HTTP/2 code of NGINX on 18 November 2026, CVE-2026-123007 and CVE-2026-123633, two of the five bugs researchers named nginx2root. Both need an affected version and HTTP/2 switched on, and Nmap can check each one from outside the server: the version from the banner, and HTTP/2 from how the server answers a connection.

This guide gives you an Nmap script that runs both checks in one scan, published on GitHub. A version check cannot tell an exposed server from one that is not: in the lab, Nmap reported two NGINX 1.31.8 servers identically, one with HTTP/2 on and one with it off. The script checks for the additional HTTP/2 condition to tell them apart. To scan your servers now, go straight to the quick check.

The short answer is to upgrade. NGINX 1.30.7 (stable) and 1.31.9 (mainline) fix both flaws, and the other three nginx2root bugs with them [7]. A restart, not a configuration reload, puts the fix in place. If you can upgrade every NGINX server today, nothing else here is required. If you cannot, Aikido's advisory gives a stopgap that covers these two flaws and not the other three: set http2 off; in each affected server block on NGINX 1.25.1 and later, or remove http2 from the listen directive on older versions [11]. Xint warns that this breaks services that need HTTP/2, such as gRPC [10]. Either way, the scan tells you which servers to prioritise first. A scan can test two of the conditions, the version and HTTP/2
What the two nginx2root HTTP/2 flaws need. CVE-2026-123007: an affected version and HTTP/2 enabled; F5 says code execution also needs ASLR disabled or bypassed, and Xint reports the bug leaks memory addresses. CVE-2026-123633: an affected version, HTTP/2, NGINX proxying to a backend, and a worker low on worker_connections, leading to a use-after-free, where the worker reuses memory it already freed.
Conditions from F5 [1][2]. A scan can check the version and HTTP/2, not the rest.

Check Your Servers for nginx2root

You need Nmap (tested on Nmap v7.993, and on v7.98 by the repository's automated tests) and the check from the nmap-detections repository. There are two ways to run it.

The wrapper. Clone the repository and run scan.sh with a hostname and, optionally, the ports. It needs python3 as well as Nmap, and prints a findings table, a summary and what to do next.

git clone https://github.com/cyberdesserts/nmap-detections.git
cd nmap-detections
./scan.sh www.example.com                 # ports 80 and 443
./scan.sh www.example.com 80,443,8443     # your own port list
./scan.sh 10.0.0.5 443 app.example.com    # scanning by IP: name the site to test

Nmap on its own. The check is one file that just needs Nmap:

curl -O https://raw.githubusercontent.com/cyberdesserts/nmap-detections/main/nse/http-vuln-cve2026-123007.nse
nmap -Pn -p 80,443 --script ./http-vuln-cve2026-123007.nse www.example.com

-Pn skips Nmap's host discovery, which otherwise reports "Host seems down" when a firewall drops its probes. In the lab it changed no result. For NGINX on other ports, add -sV and list the ports, for example nmap -Pn -sV -p 8443 --script ./http-vuln-cve2026-123007.nse www.example.com. Add --script-args vulns.showall to see NOT VULNERABLE results as well.

Scan by hostname rather than IP where you can. HTTP/2 is set per site, and the name you send determines which site answers, so a scan by IP tests only the server's default site. In the lab, one port serving two sites came back NOT VULNERABLE when scanned by IP and LIKELY VULNERABLE when scanned with the second site's name.

The script reports each CVE separately. Read the State: line, not the heading above it: Nmap prints UNKNOWN results under a VULNERABLE: heading.

What you see What it means What to do
CVE-2026-123007 LIKELY VULNERABLE The banner shows an affected version and the port negotiated HTTP/2 Upgrade to 1.30.7 or 1.31.9 and restart NGINX. If NGINX came from a distribution package, check that distribution's advisory first, because the fix may already be backported
CVE-2026-123633 UNKNOWN, naming proxy and worker_connections Version and HTTP/2 match, but this flaw also needs NGINX to proxy requests to a backend, which a scan cannot see The same upgrade fixes it. To confirm exposure, run nginx -T on the host and look for directives that pass requests to a backend, such as proxy_pass
UNKNOWN, version hidden The banner says nginx with no number (server_tokens off) Run nginx -v on the host and compare against the ranges below
UNKNOWN, HTTP/2 status could not be determined The handshake failed or was refused, for example by a listener that accepts TLS 1.3 only, which hides the protocol choice Check the config for http2 on or listen ... http2
NOT VULNERABLE Fixed version, or HTTP/2 not offered for the name you scanned Other sites on the same port can differ, so scan each hostname
No output for the port The port did not answer as NGINX Open Source, or Nmap did not identify it as HTTP Add -sV. A CDN or load balancer in front of NGINX replaces the banner, so scan the origin

The script sends one ordinary HTTP request and one TLS handshake or HTTP/2 greeting per port, nothing designed to trigger either flaw. Still scan only systems you are authorised to test.

Why Write Your Own Nmap Vulnerability Check

The quick check above is all you need to triage the two HTTP/2 flaws. The rest of the guide is for building your own Nmap script, with nginx2root as the worked example, so you can write one when the next flaw lands without a check.

The vuln category in Nmap v7.993 holds 105 scripts. The newest CVE any of them checks for is CVE-2018-15442, in smb-vuln-webexec. A bundled check reaches users only in an Nmap release, so it is not the tool for the week after a disclosure.

For newer flaws, Nmap's built-in option is vulners.nse. It takes the product and version that service detection reports and asks the vulners.com database which CVEs list that version. That works where exposure depends on the version alone. nginx2root depends on configuration too: both flaws sit in HTTP/2 handling, code that parses traffic before any login, the same place the pre-auth bugs of the past year have clustered, and a server with HTTP/2 off cannot be reached through either.

A check you write yourself can test the configuration as well as the version, and during an incident that is where its value sits. Each condition a scan can read takes servers off the list:

  1. Every server that answers as NGINX.
  2. Those running an affected version, which is as far as a version lookup goes.
  3. Those that also speak HTTP/2 on the port and name scanned, which is what this script adds.
  4. Those that also meet the conditions a scan cannot see, such as proxying to a backend. Only a check on the host confirms these.

A scan can rule a server out. It cannot rule one in. Servers left at step 3 still need someone to look at the host, or the upgrade, but there are fewer of them, and the ones dropped at step 3 can join the normal patch cycle instead of the emergency one. You can do this the day an advisory lands, without waiting for a scanner vendor to ship a check. If you have not run Nmap scripts before, the guide to Nmap scripts for vulnerability scanning covers the bundled categories and how to call them.

What the nginx2root Vulnerability Needs to Be Exploitable

HTTP/2 in brief. HTTP/2 is the newer version of the protocol that carries web traffic, and it sends many requests at once over a single connection. NGINX switches it on per site, and the browser and the server agree to use it as they connect.

NGINX Open Source is the free web server packaged by Debian, Ubuntu and other Linux distributions, and published as the official Docker images. F5 bought NGINX Inc. in 2019 and now publishes its security advisories, so the CVEs carry F5's name, but anyone running NGINX Open Source with HTTP/2 is in scope. F5's advisory [1] covers "NGINX Plus or NGINX Open Source configurations that use HTTP/2", and it also lists F5 products built on NGINX, including the Ingress Controller and Gateway Fabric.

CVE-2026-123007 CVE-2026-123633
Flaw Memory corruption in HTTP/2 flow control Use-after-free in HTTP/2
Affected NGINX Open Source 1.9.5 to 1.30.6, and 1.31.0 to 1.31.8 1.19.7 to 1.30.6, and 1.31.0 to 1.31.8
Fixed in 1.30.7 (stable), 1.31.9 (mainline) 1.30.7 (stable), 1.31.9 (mainline)
Conditions HTTP/2 enabled HTTP/2 enabled, NGINX proxying requests to a backend, and a worker process running low on worker_connections
CVSS 9.2 (v4.0), 8.1 (v3.1) 9.2 (v4.0), 8.1 (v3.1)

Sources: F5 advisory K000163926 [1] and the F5-assigned CVE record for CVE-2026-123633 [2].

NGINX maintains a stable branch (1.30.x) and a mainline branch (1.31.x), and each received its own fix. That is why 1.30.7 is patched while the numerically higher 1.31.8 is not.

F5 rates the impact as a worker crash or memory corruption, with code execution possible "on systems with Address Space Layout Randomization (ASLR) disabled or when the attacker can bypass ASLR" [1]. Two of the teams that reported CVE-2026-123007 have run code through it. Rapid7's proof of concept, against an NGINX 1.31.8 Docker image, needed about 128 GB of HTTP/2 traffic, and Rapid7 adds that bandwidth and NGINX's connection timeouts limit how practical that is across the internet [3]. Xint reports running its own exploit for the same CVE against servers on AWS, GCP and Azure over their public HTTPS endpoints, and gives no traffic figure [10]. Its exploit uses HTTP/2 control frames that NGINX does not log as requests, and the same bug leaks the memory addresses the exploit needs [10]. It also chained the flaw with a separate Linux kernel SCTP flaw, which it is not detailing until a kernel patch is available, and reached root on the host, including from NGINX inside a Docker container [10]. F5 lists no mitigation of its own. CERT-EU reported no exploitation in the wild as of its 19 November advisory [9].

The other three nginx2root bugs are fixed by the same upgrade, and the script does not test them. Each depends on configuration that a scan from outside cannot confirm:

CVE Component Affected NGINX Open Source Needs
CVE-2026-121810 HTTP/3 1.25.0 to 1.31.8 HTTP/3 enabled, with requests forwarded to a backend
CVE-2026-123634 Resolver 0.6.18 to 1.31.8 A resolver, a proxy_pass destination taken from the request, and mirror with mirror_request_body off; Xint notes other subrequest features such as SSI may reach the same bug
CVE-2026-113425 Mail proxy 0.5.33 to 1.31.8 A mail {} block using proxy on with auth_http

Sources: affected versions from nginx.org [7]; conditions as reported by Xint [10]. If any of these features appear in nginx -T output, those servers go to the top of the upgrade list whatever the scan says.

Set Up the nginx2root Test Lab

You do not need to build the lab yourself. The nmap-detections repository ships it ready to run: a Docker Compose file that starts every case on its own NGINX version and configuration (1.30.6, 1.30.7, 1.31.8 and 1.31.9), and a test runner that scans them all and checks each result against the expected one. Each container changes one thing, such as the version or whether HTTP/2 is on, so you know what the script should report for every case before you run it.

You need:

  • Nmap. The results below were produced on v7.993, and the repository's automated tests also pass on v7.98
  • python3, which the test runner uses to compare each result with the expected one
  • Docker with Compose (installation guide)
  • OpenSSL, for the lab's self-signed certificate
  • Git
  • About an hour, most of it reading the script
  • A machine you control: the lab containers are deliberately vulnerable and bind to 127.0.0.1 only

To start the lab, clone the repository, create the certificate and bring the containers up:

git clone https://github.com/cyberdesserts/nmap-detections.git
cd nmap-detections/lab/nginx2root
./gen-cert.sh
docker compose up -d
docker compose ps
cd ../..

gen-cert.sh prints Wrote certs/cert.pem and certs/key.pem. docker compose ps lists eleven services, case1 to case11, each bound to 127.0.0.1.

Case Port NGINX Configuration Tests
1 8441 1.31.8 TLS, HTTP/2 on Vulnerable baseline
2 8442 1.31.9 TLS, HTTP/2 on Fixed mainline
3 8443 1.31.8 TLS, HTTP/2 off Affected version, HTTP/2 off
4 8444 1.31.8 TLS, HTTP/2 on, server_tokens off Version hidden
5 8445 1.30.6 TLS, HTTP/2 on Last vulnerable stable
6 8446 1.30.7 TLS, HTTP/2 on Fixed stable
7 8080 1.31.8 Cleartext, http2 on HTTP/2 without TLS
8 8448 1.31.8 TLS, ECDHE with AEAD ciphers only Modern TLS profile
9 8449 1.31.8 TLS 1.3 only Protocol choice hidden
10 8450 1.31.8 Two sites on one port: the default with HTTP/2 off, app.example.com with it on Which site a scan reaches
11 8451 1.31.8 TLS, HTTP/2 on, proxying to a backend A condition the scan cannot see

If a container exits straight away, docker compose logs case1 (or the case in question) shows why. A missing certificate is the usual cause, and ./gen-cert.sh fixes it.

For a general-purpose lab beyond this one, the practice lab setup guide covers building one from scratch.

Build the Script From Parts Nmap Already Ships

Nmap scripts are Lua files that call libraries maintained by the Nmap project. This one uses http to read the banner, tls to build a handshake and vulns to format the report. Bundled scripts use the same calls: http-server-header reads the banner, tls-alpn asks which protocols a server negotiates, and http-vuln-cve2017-5638 reports through vulns. The code here was written against the libraries rather than copied from those scripts, so it can carry its own MIT licence. Full source is in the repository.

Read the version from the Server header

With server_tokens off, the header reads nginx with no number, and the function returns that case separately so the script can report it as unknown.

local function nginx_version(host, port, path)
  local resp = http.get(host, port, path)
  local server = resp and resp.header and resp.header["server"]
  if not server then
    return nil
  end
  local maj, min, patch = server:match("^nginx/(%d+)%.(%d+)%.(%d+)")
  if maj then
    return "nginx", {tonumber(maj), tonumber(min), tonumber(patch)}, server
  end
  if server:match("^nginx%s*$") then
    return "nginx", nil, server
  end
  return nil
end

Any other Server value returns nil, and the script produces no output for that port.

Check the version against both affected ranges

Comparing against a single fix version would flag 1.30.7, which is patched, or miss 1.31.8, which is not. The range test needs three boundaries:

local STABLE_FIX = {1, 30, 7}
local MAINLINE_START = {1, 31, 0}
local MAINLINE_FIX = {1, 31, 9}

local function in_range(v, first)
  if vcmp(v, first) < 0 then
    return false
  end
  if vcmp(v, STABLE_FIX) < 0 then
    return true
  end
  return vcmp(v, MAINLINE_START) >= 0 and vcmp(v, MAINLINE_FIX) < 0
end

first is 1.9.5 for CVE-2026-123007 and 1.19.7 for CVE-2026-123633. Every release from first to 1.30.6 is affected, older branches included, so the stable side needs no start value of its own: first is its lower bound. vcmp compares major, minor and patch numbers in turn.

Ask the server whether it speaks HTTP/2

A TLS client lists the protocols it supports in its first message, and the server names its choice in the reply, a mechanism called Application-Layer Protocol Negotiation, or ALPN [4]. The script offers h2 (HTTP/2) and http/1.1 and reads which one comes back:

local extensions = {
  application_layer_protocol_negotiation =
    tls.EXTENSION_HELPERS["application_layer_protocol_negotiation"]({"h2", "http/1.1"}),
  elliptic_curves = tls.EXTENSION_HELPERS["elliptic_curves"]({"ecdh_x25519", "secp256r1", "secp384r1"}),
  ec_point_formats = tls.EXTENSION_HELPERS["ec_point_formats"]({"uncompressed"}),
}
local sni = tls.servername(host)
if sni then
  extensions.server_name = tls.EXTENSION_HELPERS["server_name"](sni)
end
local hello = tls.client_hello({
  protocol = "TLSv1.2",
  ciphers = MODERN_TLS12_CIPHERS,
  extensions = extensions,
})

tls.record_read then parses the server's reply, and the script checks the ALPN value in the ServerHello. It names its own cipher list, ECDHE with AEAD ciphers first, so a server that accepts only modern ciphers still completes the handshake (lab case 8).

On a port without TLS there is nothing to negotiate. A client that already knows the server speaks HTTP/2 can open with the HTTP/2 connection preface, which the specification calls prior knowledge [5]. An HTTP/2 server answers with a SETTINGS frame. An HTTP/1.1 server answers with an error page or closes the connection:

local PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
local EMPTY_SETTINGS = string.pack(">I3 B B I4", 0, 0x4, 0, 0)

The script sends both and reads the fourth byte of the reply, which holds the frame type: 0x4 means SETTINGS. NGINX 1.31.8 with http2 on on a plain port answered the preface this way in the lab, served ordinary HTTP/1.1 on the same port, and ignored the older Upgrade: h2c request.

Neither probe sends malformed data or touches HTTP/2 flow control, and the script is tagged vuln and safe.

Report the result with the vulns library

The vulns library formats findings in Nmap's standard layout. The script supplies the state for each CVE:

Version HTTP/2 CVE-2026-123007 CVE-2026-123633
In range Negotiated LIKELY VULNERABLE UNKNOWN
In range Not offered NOT VULNERABLE NOT VULNERABLE
In range Could not tell UNKNOWN UNKNOWN
Hidden Negotiated or could not tell UNKNOWN UNKNOWN
Out of range Any NOT VULNERABLE NOT VULNERABLE

The strongest state is LIKELY VULNERABLE rather than VULNERABLE, because the version comes from a banner and a distribution package can carry a backported fix under the old version number. CVE-2026-123633 stops at UNKNOWN, because two of its four conditions, proxying and connection pressure, cannot be seen from outside. When it reports UNKNOWN, the output names both conditions:

unseen = "Exploitation also needs NGINX proxying requests to a backend "
  .. "and a worker process running short of worker_connections; this "
  .. "check cannot see either from the network.",

Run the Script and Read the Results

With the containers running, one command runs the script against every case and checks each result against the expected one. From the repository root:

lab/run-tests.sh nse/http-vuln-cve2026-123007.nse lab/nginx2root/cases.tsv

# add a file name to also save a full report: environment, results table and Nmap output
lab/run-tests.sh nse/http-vuln-cve2026-123007.nse lab/nginx2root/cases.tsv report.txt

It reads the ports from cases.tsv and runs one scan per set of script arguments. Most cases share the plain scan:

nmap -Pn -n -sT -sV --version-light -p 8080,8441,8442,8443,8444,8445,8446,8448,8449,8450,8451 \
  --script nse/http-vuln-cve2026-123007.nse --script-args vulns.showall 127.0.0.1

Case 10 is then scanned a second time with the second site's name, which reaches the other server block on the same port:

nmap -Pn -n -sT -sV --version-light -p 8450 \
  --script nse/http-vuln-cve2026-123007.nse \
  --script-args vulns.showall,tls.servername=app.example.com 127.0.0.1

app.example.com is a name reserved for documentation and does not resolve. It does not need to: NGINX picks the server block from the name sent in the TLS handshake, not from DNS.

-sV is needed because the lab uses non-standard ports and the script only runs on ports Nmap has identified as HTTP. run-tests.sh exits with an error if any case does not match. Case 1 returns:

8441/tcp open  ssl/http nginx 1.31.8
| http-vuln-cve2026-123007: 
|   VULNERABLE:
|   NGINX HTTP/2 flow control memory corruption (nginx2root)
|     State: LIKELY VULNERABLE
|     IDs:  CVE:CVE-2026-123007
|     Risk factor: High
|       NGINX 1.31.8 negotiated HTTP/2 (h2 via TLS ALPN). Affected range for this CVE: 1.9.5 to 1.30.6 and 1.31.0 to 1.31.8. Fixed in 1.30.7 and 1.31.9.
|     Disclosure date: 2026-11-18
|     Extra information:
|       Version taken from the Server header; backported distribution fixes are not visible to this check. Restart NGINX after upgrading.
|     References:
|       https://www.cve.org/CVERecord?id=CVE-2026-123007
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-123007
|       https://nginx.org/en/security_advisories.html
|   
|   NGINX HTTP/2 use-after-free (nginx2root)
|     State: UNKNOWN (unable to test)
|     IDs:  CVE:CVE-2026-123633
|     Risk factor: High
|       NGINX 1.31.8 negotiated HTTP/2 (h2 via TLS ALPN). Exploitation also needs NGINX proxying requests to a backend and a worker process running short of worker_connections; this check cannot see either from the network. Affected range for this CVE: 1.19.7 to 1.30.6 and 1.31.0 to 1.31.8. Fixed in 1.30.7 and 1.31.9.
|     Disclosure date: 2026-11-18
|     Extra information:
|       Version taken from the Server header; backported distribution fixes are not visible to this check. Restart NGINX after upgrading.
|     References:
|       https://www.cve.org/CVERecord?id=CVE-2026-123633
|       https://nginx.org/en/security_advisories.html
|_      https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-123633

Twelve cases, using two Nmap versions

Case Configuration CVE-2026-123007 CVE-2026-123633
1 1.31.8, HTTP/2 on LIKELY VULNERABLE UNKNOWN
2 1.31.9, HTTP/2 on NOT VULNERABLE NOT VULNERABLE
3 1.31.8, HTTP/2 off NOT VULNERABLE NOT VULNERABLE
4 1.31.8, version hidden UNKNOWN UNKNOWN
5 1.30.6, HTTP/2 on LIKELY VULNERABLE UNKNOWN
6 1.30.7, HTTP/2 on NOT VULNERABLE NOT VULNERABLE
7 1.31.8, cleartext HTTP/2 LIKELY VULNERABLE UNKNOWN
8 1.31.8, modern ciphers only LIKELY VULNERABLE UNKNOWN
9 1.31.8, TLS 1.3 only UNKNOWN UNKNOWN
10a 1.31.8, two sites, scanned by IP NOT VULNERABLE NOT VULNERABLE
10b 1.31.8, two sites, scanned with app.example.com LIKELY VULNERABLE UNKNOWN
11 1.31.8, HTTP/2 on, proxying to a backend LIKELY VULNERABLE UNKNOWN

All twelve matched the expected state on Nmap v7.993 on macOS. The repository runs the same twelve cases on every change, on Nmap v7.98 on Ubuntu, and they match there too. Each TLS case was cross-checked with openssl s_client -alpn h2,http/1.1, which confirmed the protocol the server chose. Case 9 refuses the script's TLS 1.2 handshake, and TLS 1.3 encrypts the protocol choice, so the script reports UNKNOWN. Case 11 proxies to a backend and returns exactly what case 1 returns, which is why CVE-2026-123633 cannot go above UNKNOWN: from outside, the two servers look the same.

What a version-only check sees

Case 1 and case 3 both run NGINX 1.31.8. Case 1 has HTTP/2 on and case 3 has it off. Nmap's service detection reports them identically:

Port Case HTTP/2 Product Version CPE
8441 1 On nginx 1.31.8 cpe:/a:igor_sysoev:nginx:1.31.8
8443 3 Off nginx 1.31.8 cpe:/a:igor_sysoev:nginx:1.31.8

Any check that works from product, version and CPE alone has to give both ports the same verdict, whatever database it queries. That is the mistake. The script reads ALPN as well, and reported case 1 as LIKELY VULNERABLE and case 3 as NOT VULNERABLE.

Common Mistakes When Writing Nmap Vulnerability Scripts

Assuming the target has a name. The first version crashed against an IP address. tls.servername() returns nothing when there is no hostname, and the SNI helper fails on an empty value. Sending SNI only when a name exists fixed it. Run every new script against both an IP and a hostname before relying on it.

Treating a version match as exposure. Case 3 runs an affected version and cannot be reached through either CVE. Version tells you what needs upgrading eventually. Testing the bug's conditions tells you what is exposed today, wherever the network can show them.

Reporting a condition the script never tested. For CVE-2026-123633, version and HTTP/2 are two of four conditions. A LIKELY VULNERABLE verdict would rest on half the evidence.

Trusting the heading. The vulns library groups UNKNOWN results under VULNERABLE:, so anyone counting headings will report cases 4 and 9 as findings. Read the State: line. UNKNOWN means go and check the host.

Using the Scan During an Incident

Because the script sends nothing malformed, it can run against production while you work out what to patch. The quick-check table says what each result means for one server. Across an estate, the results also set the order of work:

  1. LIKELY VULNERABLE on CVE-2026-123007. Upgrade and restart these first, after the distribution check in the table.
  2. UNKNOWN. Each one needs a check on the host: nginx -v when the version is hidden, and nginx -T for the HTTP/2 setting or, for CVE-2026-123633, whether NGINX proxies to a backend.
  3. NOT VULNERABLE because HTTP/2 is off. Still on an affected version, so schedule the upgrade, but these cannot be reached through either flaw as configured.
  4. NOT VULNERABLE on a fixed version. Confirm NGINX was restarted after the upgrade and move on.
If you turn HTTP/2 off instead of upgrading, find what depends on it first, because services that need HTTP/2, such as gRPC, stop working without it [10]. Then rescan: the script shows whether each port and site name still negotiates HTTP/2, which is how you know the stopgap took.

Aim the scan at the origin from inside the network rather than at a CDN, load balancer or WAF, and pass --script-args tls.servername=app.example.com to test a site other than the default one.

Adapting the Script for Another CVE

A new CVE can be checked the same way when the vendor advisory answers four questions. Each answer maps to a part of the script you change.

You need to know Where it usually comes from What it changes in the script
How the product identifies itself on the network, and its exact version string Running the product in a lab and reading what it returns: a Server header, a version endpoint, a login page, a TLS certificate nginx_version(): the request and the pattern that pulls out the version
The affected versions and fixed versions, branch by branch The vendor advisory or the CVE record's affected-versions data The fix constants and in_range()
The conditions the flaw needs: a feature switched on, a module loaded, a setting The vendor advisory, then the researcher's write-up for detail The probe: for nginx2root, the ALPN and h2c checks
Which of those conditions a client can observe without triggering the flaw Your own testing against the lab Whether each CVE can reach LIKELY VULNERABLE or stops at UNKNOWN (the unseen text)

Whether the conditions can be observed decides how much work the probe takes. For nginx2root, HTTP/2 shows up in an ordinary handshake, so the probe is a few lines. Some conditions cannot be observed safely at all. The only network test for a memory corruption bug may be to send the input that corrupts memory, and that is an exploit, not a check. Others sit entirely inside the host: a CPU feature, a configuration value the server never reveals, a resource limit. Where that happens, the script should report the version and say UNKNOWN for the rest, the way this one handles CVE-2026-123633.

You do not need the exploit details. You need the conditions, stated precisely enough to test, and a vulnerable and a fixed build to test against. When neither the advisory nor the research gives more than "versions before X", the check can only be a version match, and it should say so in its output.

Once the script runs, build a lab case for every result it can return before pointing it at a real server. The affected version with the feature switched off is the case a version-only check gets wrong, and the first fixed version on each branch proves the range boundaries, so both belong in the lab.

The repository includes a starting point for this: a template script with the four answers as marked edit blocks, and a four-case lab skeleton with a checker that compares any scan against a table of expected results. As shipped, the template is filled in with the nginx2root values. The repository's automated tests run it against the nginx2root lab on every change and fail if its results ever differ from the real script's, so you start from a version that has been tested.

Results from NGINX builds the lab does not cover are welcome as issues on nmap-detections.

Summary

The script tests the two conditions of the nginx2root HTTP/2 flaws that a network scan can see, the NGINX version and HTTP/2, and says UNKNOWN for the ones it cannot. Across twelve lab cases it separated the exposed servers from those that only run an affected version, which the service detection record alone could not. The script, the lab and the results are in nmap-detections, and the same four questions about product, versions, conditions and what is observable will tell you whether the next CVE can be checked the same way.


References

  1. F5. (2026). K000163926: NGINX ngx_http_v2_module vulnerability CVE-2026-123007. https://my.f5.com/manage/s/article/K000163926
  2. F5 (as CNA), via CVE.org. (2026). CVE-2026-123633. https://www.cve.org/CVERecord?id=CVE-2026-123633
  3. Rapid7. (2026). CVE-2026-123007: Critical NGINX HTTP/2 Integer Underflow Leads to RCE (FIXED). https://www.rapid7.com/blog/post/ve-cve-2026-123007-critical-nginx-http-2-integer-underflow-leads-to-rce-fixed/
  4. IETF. (2014). RFC 7301: Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension. https://www.rfc-editor.org/rfc/rfc7301
  5. IETF. (2022). RFC 9113: HTTP/2, section 3.3, prior knowledge. https://www.rfc-editor.org/rfc/rfc9113
  6. Nmap Project. Nmap Scripting Engine documentation. https://nmap.org/book/nse.html
  7. nginx.org. nginx security advisories. https://nginx.org/en/security_advisories.html
  8. CyberDesserts. (2026). nmap-detections: the check, lab and test results. Release v1.0.0 is the version this article describes. https://github.com/cyberdesserts/nmap-detections/releases/tag/v1.0.0
  9. CERT-EU. (2026). Security Advisory 2026-022: Critical vulnerabilities in Nginx. https://cert.europa.eu/publications/security-advisories/2026-022/
  10. Xint. (2026). NGINX2Root: New Remote Code Execution Vulnerabilities in nginx Require Urgent Patching. https://xint.io/blog/nginx2root-remote-code-execution
  11. Aikido (Hunter Schwartz). (2026). nginx2root: Critical nginx RCE vulnerabilities and how to fix them. https://www.aikido.dev/blog/nginx2root-critical-nginx-rce-vulnerabilities