CVE

NGINX Rewrite Exposure (CVE-2026-42945)

Fingerprint NGINX servers with two passive GETs and sort versions against the CVE-2026-42945 fix line, without sending the rewrite URI that crashes a worker.

AuthorTrickest
100%

Notes on this workflow

Results\nfindings.jsonl carries every probe field plus enrichment: verdict (affected_version / nginx_unknown_version / not_nginx / patched_version / inconclusive / error), severity (HIGH affected, UNKNOWN unresolvable, INFO fixed/not-nginx), remediation (upgrade + restart; interim named-capture rewrite mitigation), config-review flag, and a note when a version sits between the CVE-2026-42945 and CVE-2026-9256 fixed lines (gates differ, only 42945 is classified here). KEV no, EPSS 3.4%, public PoC yes, no confirmed exploitation.

Parse\nNormalizes targets into one row per (host, port, scheme). Deduplicates, drops malformed lines, keeps the inventory version/edition if provided.

How it works\nExactly 2 passive GETs per host: / plus one nonexistent path. Fingerprint NGINX via Server header and default 404 page, then compare the disclosed version against the OSS 0.6.27-1.30.0 affected range (1.30.1+/1.31.0+ fixed) and the Plus R32/R36 patch levels. server_tokens off yields nginx_unknown_version, never 'unaffected'. No exploit-shaped request is ever sent - the only discriminating request deterministically crashes the worker (DoS), so classification is version signal + config-review flag. Fail closed: unreachable/5xx -> error rows.

Target\nWeb servers running NGINX OSS or NGINX Plus. Accepts a targets JSONL (host/ip/port/scheme) or plain host lines; optional inventory rows carry an nginx version/edition when the server hides its version banner.

Overview

This workflow screens NGINX servers for CVE-2026-42945, the heap overflow in the rewrite module that has existed since NGINX 0.6.27 and can crash or, on some builds, compromise a worker process from any HTTP client. The bug needs a common configuration shape, a rewrite directive with an unnamed capture and a question-mark replacement followed by more rewrite instructions in the same scope, and that shape cannot be read from outside the server. So the honest detection is a version screen: it identifies NGINX, sorts the banner version against the fixed releases, and flags every NGINX host for configuration review. There is no safe exploitability probe, because the only request that discriminates vulnerable from patched is a crafted URI that deterministically crashes the worker, and this workflow will never send one. Each host comes back with a verdict you can feed into exposure management.

Pipeline

  1. Read the target list and send two passive GETs per host, single attempt and no retries: one to the root page for the Server header and page traits, one to a nonexistent probe path for error-page traits and ingress default-backend detection.
  2. The probe paths are fixed constants, and the safety guard rejects any path carrying percent-encoding, plus signs, or query syntax, so the exploit-shaped rewrite URI cannot be constructed even by accident. No POSTs, no header manipulation.
  3. Parse the version from the Server header or error-page text and classify it against the OSS fix line, 1.30.1 and 1.31.0, or the NGINX Plus fixes, R32 P6 through R36 P4.
  4. Keep the two sibling bugs apart: a version sitting between the 1.30.1 and 1.30.2 fix points is flagged with a note, since the rewrite overflow this page covers and the separate rewrite-module CVE-2026-9256 have different fix releases and must not be conflated.
  5. Reconcile one verdict per target and write findings plus summary counts.

Inputs

  • Target list. Web server addresses you are authorized to fingerprint. The default file ships a sample host; bind your own.

Outputs

  • findings.jsonl. One row per host: target, the Server header evidence, the parsed version and which fix line it compares against, verdict, severity, and the config-pattern review note.
  • summary.jsonl. One line with the total, verdict counts, and the advisory metadata including the explicit no-KEV and no-exploitation statement.

Integrations

  • HTTP. Exactly two GETs per host on fixed paths, no retries, no request bodies, no header tricks.

Sample output

The records below are illustrative and do not come from a real run. They show a server on an affected version, a patched one, and one where the sibling CVE needs separate treatment.

targetserver_headerversion_sourceverdictdetailerror
https://web-a.example.comnginx/1.29.4server_headeraffected_versionbelow the 1.30.1/1.31.0 fix; config-pattern review requirednull
https://web-b.example.orgnginx/1.31.0server_headerpatched_versionat the 1.31.0 fixnull
https://web-c.example.netnginx/1.30.1server_headerversion_not_listedat the CVE-2026-42945 fix but below the CVE-2026-9256 fix line; sibling bug needs its own checknull
{"cve": "CVE-2026-42945", "product": "NGINX ngx_http_rewrite_module", "total_targets": 3, "verdict_counts": {"affected_version": 1, "patched_version": 1, "version_not_listed": 1}, "kev": false, "config_pattern_note": "the vulnerable shape is a rewrite with an unnamed capture and a question-mark replacement plus further rewrite directives in the same scope"}

FAQ

Does an affected_version verdict mean the server is vulnerable?

No. It means the version sits below the fix for a bug that also needs a specific rewrite configuration pattern to become reachable, and that pattern cannot be observed remotely. Treat the row as a version screen that triggers a config review on the host, not as proof of exposure.

Why not just send the crafted URI?

The only request that distinguishes vulnerable from patched deterministically crashes the worker process, which is a denial-of-service action against the target. The workflow refuses to send it by construction: the path guard rejects any URI that could carry the exploit shape.

Which versions are affected?

Every NGINX OSS build from 0.6.27 through 1.30.0 and NGINX Plus R32 through R36 before their patch releases. The fixes are 1.30.1 and 1.31.0 on OSS and R32 P6, R36 P4 on Plus. NGINX builds from 1.30.2 to the 1.31 line need the separate rewrite-module CVE-2026-9256 check instead.

Is this bug exploited in the wild?

No confirmed exploitation. CISA's coordinator scored exploitation as none, it is not on the KEV list, and public exploit code exists from the researcher disclosure. Patching is a version-hygiene task, not an incident response.

Get a personalized demo

See Trickest in Action

A 30-minute walkthrough. We map the platform to your stack and answer pricing and deployment questions for your environment.