CVE-2026-42945: NGINX Plus and NGINX Open Source have a vulnerability in the ngx_http_rewrite_module module.
High CVSS 8.1
- CVE id
- CVE-2026-42945
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| NGINX Runtimes and servers |
>= 0.6.27, <= 1.30.0 | after 1.30.0 |
| NGINX App Protect WAF Runtimes and servers |
>= 4.9.0, <= 4.16.0 >= 5.1.0, <= 5.8.0 >= 5.9.0, <= 5.12.1 |
after 4.16.0, 5.8.0, 5.12.1 |
| NGINX Gateway Fabric Runtimes and servers |
>= 1.3.0, <= 1.6.2 >= 2.0.0, <= 2.5.1 |
after 1.6.2, 2.5.1 |
| F5 NGINX Ingress Controller Runtimes and servers |
>= 3.5.0, <= 3.7.2 >= 4.0.0, <= 4.0.1 >= 5.0.0, <= 5.4.1 |
after 3.7.2, 4.0.1, 5.4.1 |
| NGINX Plus Runtimes and servers |
>= 32, <= 36 | after 36 |
How to fix it
NGINX (Runtimes and servers)
Upgrade NGINX to a release newer than 1.30.0.
nginx -v
- Install the patched NGINX release of your branch (the nginx image tag, the nginx.org packages, or your distribution's security update) and restart NGINX; with OpenResty, upgrade to the OpenResty release built on it.
NGINX App Protect WAF (Runtimes and servers)
Upgrade NGINX App Protect WAF to a release newer than the last affected update of the line you run (4.16.0, 5.8.0, 5.12.1).
- Upgrade NGINX App Protect WAF (the app-protect packages, or the waf-enforcer and waf-config-mgr images) to the patched release.
NGINX Gateway Fabric (Runtimes and servers)
Upgrade NGINX Gateway Fabric to a release newer than the last affected update of the line you run (1.6.2, 2.5.1).
kubectl get deploy -A -l app.kubernetes.io/name=nginx-gateway-fabric -o jsonpath='{..image}'
- Upgrade NGINX Gateway Fabric (its Helm chart or the nginx-gateway-fabric images) to the patched release.
F5 NGINX Ingress Controller (Runtimes and servers)
Upgrade F5 NGINX Ingress Controller to a release newer than the last affected update of the line you run (3.7.2, 4.0.1, 5.4.1).
kubectl get deploy -A -l app.kubernetes.io/name=nginx-ingress -o jsonpath='{..image}'
- Upgrade the NGINX Ingress Controller image (nginx/nginx-ingress or nginx-plus-ingress) or its Helm chart to the patched release and roll it out to every cluster.
NGINX Plus (Runtimes and servers)
Upgrade NGINX Plus to a release newer than 36.
nginx -v
- Upgrade NGINX Plus to the patched release from the F5 repository (or your nginx-plus image) and restart it.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
NGINX Plus and NGINX Open Source have a vulnerability in the ngxhttprewrite_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.
References
- CVE-2026-42945 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-42945
- Web: https://my.f5.com/manage/s/article/K000161019
- Web: https://depthfirst.com/nginx-rift
- Web: https://github.com/DepthFirstDisclosures/Nginx-Rift
- Web: https://access.redhat.com/errata/RHSA-2026:17417
- Web: https://access.redhat.com/errata/RHSA-2026:17751
- Web: https://access.redhat.com/errata/RHSA-2026:17752
- Web: https://access.redhat.com/errata/RHSA-2026:17753
- Web: https://access.redhat.com/errata/RHSA-2026:17790
- Web: https://access.redhat.com/errata/RHSA-2026:17791
- Web: https://access.redhat.com/errata/RHSA-2026:17792
- Web: https://access.redhat.com/errata/RHSA-2026:17793
- Web: https://access.redhat.com/errata/RHSA-2026:17794
- Web: https://access.redhat.com/errata/RHSA-2026:18029
- Web: https://access.redhat.com/errata/RHSA-2026:18041
- Web: https://access.redhat.com/errata/RHSA-2026:18063
- Web: https://access.redhat.com/errata/RHSA-2026:19159
- Web: https://access.redhat.com/errata/RHSA-2026:19371
- Web: https://access.redhat.com/errata/RHSA-2026:19372
- Web: https://access.redhat.com/errata/RHSA-2026:19374
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.