CVE-2026-42945: NGINX ngx_http_rewrite_module vulnerability
Last updated 6 June 2026
Other sources
NGINX ngxhttprewritemodule vulnerability
— Microsoft
NGINX Plus and NGINX Open Source have a vulnerability in the ngxhttprewritemodule 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.
— MITRE
NGINX Plus and NGINX Open Source have a vulnerability in the ngxhttprewritemodule 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, for systems with Address Space Layout Randomization (ASLR ) disabled, code execution is possible. Note: Software versions which have reached End of Technical Support (EoTS) are not evaluated.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/nginxto a version that resolves this vulnerability.Fixed in 1.18.0-6.1+deb11u6Fixed in 1.22.1-9+deb12u7Fixed in 1.26.3-3+deb13u5Fixed in 1.30.1-3
Event History
Frequently Asked Questions
What is the severity of CVE-2026-42945?
CVE-2026-42945 has been assigned a high severity rating due to the potential for code execution through crafted rewrite rules.
How do I fix CVE-2026-42945?
To fix CVE-2026-42945, update NGINX to version 1.30.0-3 or later.
Which versions of NGINX are affected by CVE-2026-42945?
CVE-2026-42945 affects NGINX Plus and NGINX Open Source versions prior to 1.30.0-3.
What is the impact of CVE-2026-42945?
The impact of CVE-2026-42945 includes possible remote code execution when processing specific rewrite directives.
Is CVE-2026-42945 exploitable remotely?
Yes, CVE-2026-42945 is exploitable remotely if an attacker can manipulate the NGINX rewrite configuration.