18-Year-Old NGINX Flaw Enables Remote Code Execution Attacks – PoC Released

A critical vulnerability buried inside NGINX’s source code since 2008 has finally been dragged into the light, and attackers already have a working exploit to use against it.

Security researchers at depthfirst publicly released a proof-of-concept (PoC) exploit demonstrating unauthenticated remote code execution (RCE) against NGINX, the world’s most widely deployed web server, powering nearly one-third of all websites globally.

Tracked as CVE-2026-42945 and codenamed NGINX Rift, the flaw carries a critical CVSS v4.0 score of 9.2 and went completely undetected for 18 years.

NGINX Rift Flaw

CVE-2026-42945 is a heap buffer overflow residing in NGINX’sngx_http_rewrite_module, introduced in version 0.6.27 back in 2008 and present in every release through 1.30.0.

Notably, this bug wasn’t found by a human researcher; depthfirst’s AI-powered source code analysis system autonomously identified it after just six hours of scanning, uncovering four remote memory corruption issues in total.

The depthfirst system identified 4 remote memory corruption issues in NGINX (Source: Depthfirst)
The depth-first system identified 4 remote memory corruption issues in NGINX (Source: Depthfirst)

The root cause lies in NGINX’s two-pass script engine that handles rewrite and set directives. During the first pass, NGINX calculates how much memory to allocate.

During the second pass, it copies data into that buffer. The critical flaw: when a rewrite directive contains a question mark, it permanently sets an internal is_args flag on the main engine, but this flag never propagates to the sub-engine used during length calculation.

The result is that the copy phase writes far more data than the allocated buffer can hold, causing a heap overflow with fully attacker-controlled content.

Exploitation requires zero authentication and is directly reachable from the public internet. An attacker simply sends a crafted HTTP request containing URI characters such as +, &, or % to trigger the overflow.

Because NGINX’s multi-process architecture automatically restarts crashed workers with an identical heap layout, attackers can retry the exploit indefinitely without permanently taking the server down.

Researchers confirmed a working PoC achieving full RCE on systems with ASLR disabled, while also theorizing ASLR bypass through progressive heap pointer overwriting across multiple requests.

Three Additional CVEs and Affected Products

The same AI analysis exposed three more confirmed vulnerabilities in NGINX:

  • CVE-2026-42946 (High, CVSS 8.3): Excessive memory allocation in ngx_http_scgi_module and ngx_http_uwsgi_module, generating a ~1 TB key length that crashes worker processes
  • CVE-2026-40701 (Medium, CVSS 6.3): Use-after-free in ngx_http_ssl_module where a freed memory pointer is dereferenced after TLS closure during async OCSP DNS resolution
  • CVE-2026-42934 (Medium, CVSS 6.3): Out-of-bounds read in ngx_http_charset_module caused by an off-by-one error when handling incomplete UTF-8 sequences across proxy buffer boundaries

The vulnerabilities affect a broad range of F5 and NGINX products, including NGINX Open Source 0.6.27 through 1.30.0, NGINX Plus R32–R36, NGINX Instance Manager 2.16.0–2.21.1, NGINX App Protect WAF 4.9.0–5.8.0, and NGINX Ingress Controller 3.5.0–5.4.1.

F5 released an official security advisory on May 13, 2026. Administrators must upgrade to NGINX 1.31.0 or 1.30.1 immediately.

For those unable to patch right away, auditing configurations to remove or isolate rewrite and set directive combinations serves as a critical interim mitigation.

Follow us on Google News , LinkedIn and X to Get More Instant Updates. Set Cyberpress as a Preferred Source in Google

AnuPriya
AnuPriya
Any Priya is a cybersecurity reporter at Cyber Press, specializing in cyber attacks, dark web monitoring, data breaches, vulnerabilities, and malware. She delivers in-depth analysis on emerging threats and digital security trends.

Trending News

Related Stories