18-Year-Old NGINX Rewrite Flaw Could Enable Unauthenticated RCE

· Original article ↗

Summary

F5 disclosed an 18-year-old heap overflow in NGINX’s rewrite module, which crafted HTTP requests can trigger without authentication, potentially causing remote code execution or worker crashes. F5 also patched three other flaws and recommends upgrades or a configuration

Key points

  • CVE-2026-42945, named NGINX Rift, is a heap buffer overflow in ngx_http_rewrite_module.
  • An unauthenticated attacker can trigger the flaw with crafted HTTP requests when affected rewrite directives use unnamed regex captures and a replacement string containing a question mark.
  • The flaw can crash or restart NGINX workers; F5 says code execution is possible on systems with ASLR disabled.
  • Affected NGINX versions have fixes in NGINX Plus R32 P6 and R36 P4, and NGINX Open Source 1.30.1 and 1.31.0; no fixes are planned for versions 0.6.27–0.9.7.
  • F5 also patched CVE-2026-42946, CVE-2026-40701, and CVE-2026-42934, affecting other NGINX modules.
  • If CVE-2026-42945 cannot be patched immediately, F5 advises replacing unnamed regex captures with named captures in affected rewrite directives.

Article Details

Vulnerability Types
  • Heap buffer overflow
  • Excessive memory allocation
  • Use-after-free
  • Out-of-bounds read
Severity
Critical; CVE-2026-42945 has a CVSS v4 score of 9.2.
Affected Versions
  • NGINX Plus R32–R36
  • NGINX Open Source 1.0.0–1.30.0
  • NGINX Open Source 0.6.27–0.9.7
  • NGINX Instance Manager 2.16.0–2.21.1
  • F5 WAF for NGINX 5.9.0–5.12.1
  • NGINX App Protect WAF 4.9.0–4.16.0
  • NGINX App Protect WAF 5.1.0–5.8.0
  • F5 DoS for NGINX 4.8.0
  • NGINX App Protect DoS 4.3.0–4.7.0
  • NGINX Gateway Fabric 1.3.0–1.6.2
  • NGINX Gateway Fabric 2.0.0–2.5.1
  • NGINX Ingress Controller 3.5.0–3.7.2
  • NGINX Ingress Controller 4.0.0–4.0.1
  • NGINX Ingress Controller 5.0.0–5.4.1
Exploitation Status
unknown
Exploit Availability
unknown
Patch Status
partial
Workarounds
  • For CVE-2026-42945, replace unnamed captures with named captures in every affected rewrite directive.

MITRE ATT&CK

CVE

Vendors

Products

Related Articles