Vulnerability record · CVE-2026-42945 · published 13 May 2026
CVE-2026-42945: NGINX rewrite module heap buffer overflow via crafted HTTP requests
F5 · Dos
NGINX Plus and NGINX Open Source contain a heap buffer overflow in the ngx_http_rewrite_module when a rewrite directive is followed by another rewrite, if, or set directive and an unnamed PCRE capture (such as $1) is used in a replacement string containing a question mark. An unauthenticated attacker can trigger the overflow with crafted HTTP requests, crashing the worker process and potentially executing code where ASLR is disabled or bypassable.
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.
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:
Automated analysis
critical priorityCVSS 4.0 score of 9.2 with network reachability, no authentication required, high confidentiality/integrity/availability impact, and a public exploit reference.
What it is
NGINX Plus and NGINX Open Source contain a heap buffer overflow in the ngx_http_rewrite_module when a rewrite directive is followed by another rewrite, if, or set directive and an unnamed PCRE capture (such as $1) is used in a replacement string containing a question mark. An unauthenticated attacker can trigger the overflow with crafted HTTP requests, crashing the worker process and potentially executing code where ASLR is disabled or bypassable.
Impact
Attackers can crash or restart NGINX worker processes, causing denial of service, and may achieve code execution on systems with ASLR disabled or bypassable.
Attack surface
Reachable over the network via crafted HTTP requests to servers whose configuration uses the affected rewrite/if/set pattern with unnamed PCRE captures and a question mark in the replacement string. No authentication or user interaction is required, though exploitation depends on conditions beyond the attacker's control.
Exploitation
Not listed in CISA KEV, but EPSS is very high (0.68 probability, 99.3rd percentile) and a public exploit reference exists (DepthFirstDisclosures/Nginx-Rift), indicating active interest and available proof-of-concept code.
What to do
- Apply the vendor patch or upgrade to a fixed NGINX Plus / NGINX Open Source release per F5 advisory K000161019 and Red Hat errata.
- Audit nginx configurations for rewrite directives followed by rewrite, if, or set that use unnamed PCRE captures ($1, $2) with a question mark in the replacement string, and rewrite them to avoid the pattern.
- Enable ASLR on all hosts running NGINX to reduce the chance of code execution from the overflow.
- Restrict or monitor external access to NGINX endpoints that use affected rewrite configurations until patching is complete.
Detection
- Monitor NGINX worker process crashes, unexpected restarts, or core dumps correlated with HTTP request bursts.
- Inspect HTTP request logs for requests targeting URIs that exercise rewrite rules with unnamed captures and question-mark replacements.
- Alert on repeated 5xx responses or connection resets from NGINX instances running affected configurations.
- Track EPSS and vendor advisories for updated exploitation status and patch guidance.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
7 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2026-42945 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2026-42945), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.