Skip to content
Security Alerts

CVE-2026-42945: Critical RCE in NGINX ngx_http_rewrite_module (Public PoC Available)

Critical RCE vulnerability in NGINX ngx_http_rewrite_module present in source code since 2008 - heap buffer overflow in rewrite and set directive handling allows unauthenticated remote code execution...

Summary

ParameterValue
CVE IDCVE-2026-42945
Alert SourceF5 Security Advisory (K000160932)
CVE Publication Year2026
Date Published2026-05-28
VendorF5 (NGINX)
ProductNGINX (ngx_http_rewrite_module)
Vulnerability TypeRemote Code Execution (Heap Buffer Overflow)
CVSS Score9.2 (critical)
Public PoCYES — available on GitHub
CISA KEVNot yet
RansomwareNot confirmed

Vulnerability Description

Source: F5 Security Advisory

A critical vulnerability in NGINX’s ngx_http_rewrite_module allows an unauthenticated remote attacker to execute arbitrary code on vulnerable systems. The issue is caused by a heap buffer overflow triggered by improper handling of rewrite and set directives in NGINX configuration. Specially crafted HTTP requests can lead to remote code execution in the context of the NGINX worker process.

According to researchers, the vulnerability has existed in the NGINX source code since 2008 and impacts a broad range of NGINX- and F5-based products. A working Proof-of-Concept (PoC) exploit has been publicly released on GitHub, significantly increasing the risk of mass exploitation in the coming days.

The same F5 advisory also covers 3 additional memory corruption vulnerabilities (CVE-2026-42946, CVE-2026-40701, CVE-2026-42934).

Required Actions

Highest update priority — the public PoC means real risk of mass exploitation.

Update vulnerable NGINX/F5 products to vendor-fixed releases:

  • NGINX Open Source (0.6.27 — 1.30.0) — upgrade to the latest patched release
  • NGINX Plus (R32 — R36) — upgrade per F5 advisory
  • 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 and 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 and 2.0.0 — 2.5.1)
  • NGINX Ingress Controller (3.5.0 — 3.7.2, 4.0.0 — 4.0.1, 5.0.0 — 5.4.1)

Workarounds for systems that cannot be patched immediately:

  1. Review NGINX configurations for combined use of rewrite and set directives (the primary attack vector) — temporarily disable complex rewrite rules where feasible.
  2. Place vulnerable systems behind an additional WAF protection layer (e.g., AWS WAF, Cloudflare, Imperva) with malicious HTTP payload inspection rules enabled.
  3. Deploy IDS/IPS signatures that detect attempts to exploit the known PoC.
  4. Monitor NGINX logs and worker processes for unusual crashes (a typical indicator of buffer overflow exploitation attempts).

Who Is Affected?

This vulnerability affects a massive portion of the internet infrastructure — NGINX currently serves roughly one-third of the world’s websites. Practically every organization should assess exposure:

  • Production web servers — NGINX Open Source and NGINX Plus as reverse proxy, load balancer, edge gateway
  • Containers and Kubernetes — NGINX Ingress Controller is the default ingress in many K8s clusters
  • API Gateway — NGINX as a frontend for microservices
  • WAF and application protection — F5 WAF for NGINX, NGINX App Protect (ironically: the WAF itself is vulnerable)
  • Edge / CDN — NGINX often serves as the first line of traffic reception

Since the vulnerability has existed since 2008 and requires only an HTTP request to an unauthenticated endpoint, automated scanners and botnets can be expected to begin mass exploitation within hours/days of the PoC’s release.

Sources


Need help securing your systems? nFlo team offers vulnerability management and 24/7 SOC services. Contact us.

Learn More

Share:

Talk to an expert

Have questions about this topic? Get in touch with our specialist.

Sales Representative
Grzegorz Gnych

Grzegorz Gnych

Sales Representative

Response within 24 hours
Free consultation
Individual approach

Providing your phone number will speed up contact.

Want to Reduce IT Risk and Costs?

Book a free consultation - we respond within 24h

Response in 24h Free quote No obligations