ZeroHour

CVE-2026-42945

PoC mass

Heap Buffer Overflow in NGINX Plus & Open Source rewrite module — DoS, potential RCE

CVSS 4.0
9.2 critical
EPSS
68%p99
Published
()
Modified
AI analysis

NGINX Plus and NGINX Open Source contain a heap buffer overflow (CWE-122, from an incorrect buffer size calculation per CWE-131) in the ngx_http_rewrite_module, triggered when a rewrite directive is followed by a rewrite, if, or set directive and an unnamed PCRE capture (e.g., $1, $2) whose replacement string includes a question mark. An unauthenticated remote attacker can trigger the flaw with crafted HTTP requests, but only on servers whose configuration includes this specific directive pattern — hence the high-attack-complexity rating despite the 9.2 CVSS v4.0 score. Successful exploitation causes a heap overflow in the NGINX worker process, crashing it and forcing a restart (availability impact), and can result in code execution on hosts where ASLR is disabled or can be bypassed. All F5 NGINX products built on the NGINX codebase are affected — NGINX Plus, NGINX Open Source, NGINX Ingress Controller, NGINX Gateway Fabric, NGINX Instance Manager, NGINX WAF, and NGINX App Protect DoS — while versions past End of Technical Support were not evaluated. Exploitation has not yet been confirmed in the wild and the flaw is not in CISA KEV, but a public proof-of-concept ('Nginx-Rift') is available and EPSS assigns a 68% probability of exploitation within 30 days (99th percentile).

What to do: Upgrade NGINX Plus, NGINX Open Source, and each affected F5 NGINX-derived product (Ingress Controller, Gateway Fabric, Instance Manager, WAF, App Protect DoS) to the patched releases listed in F5's security advisory, noting that EoTS versions were not evaluated and need separate remediation. Interim mitigation: audit nginx configurations for rewrite directives chained with another rewrite, if, or set where unnamed captures ($1, $2, ...) appear in a replacement string containing '?', and remove or restructure those directives (e.g., drop the trailing '?'). Prioritize systems with ASLR disabled, where exploitation could yield remote code execution rather than just a worker-process crash/restart.

Affected
F5 NGINX Plus
F5 NGINX Open Source
F5 NGINX Ingress Controller (CPE: nginx ingress controller)
F5 NGINX Gateway Fabric (CPE: nginx gateway fabric)
F5 NGINX Instance Manager (CPE: nginx instance manager)
F5 NGINX WAF (CPE: waf)
F5 NGINX DoS / App Protect DoS (CPE: dos)
Estimated exposure
mass≈1,000,000+ internet-exposed NGINX deployments potentially in scope (a smaller subset with the specific rewrite/if/set + unnamed-capture + '?' configuration is… — NGINX is the most widely deployed web server, serving roughly a third of all websites with millions of exposed instances visible in public internet scans, so the potential pool is mass-scale even though only configurations using the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

NGINX Plus and NGINX Open Source have a vulnerability in the ngx_http_rewrite_module module. This vulnerability exists when the rewrite directive is followed by a rewrite, if, or set directive and an unnamed Perl-Compatible Regular Expression (PCRE) capture (for example, $1, $2) with a replacement string that includes a question mark (?). An unauthenticated attacker along with conditions beyond its control can exploit this vulnerability by sending crafted HTTP requests. This may cause a heap buffer overflow in the NGINX worker process leading to a restart. Additionally, attackers can execute code on systems with Address Space Layout Randomization (ASLR) disabled or when the attacker can bypass ASLR. Note: Software versions which have reached End of Technical Support (EoTS) are not evaluated.

Vendors
f5
Products
dos, nginx gateway fabric, nginx ingress controller, nginx instance manager, nginx open source, nginx plus, waf
Weakness
CWE-122, CWE-131
Vector
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news