An 18‑year‑old heap overflow in NGINX’s rewrite module (CVE‑2026‑42945) is already being probed in the wild. Researchers measured exposure on millions of internet‑facing servers and broke down the realistic attack surface, while offering hardening steps for homelab and production deployments.
NGINX Rift Exploits Hit the Wire Within Days of Disclosure

CVE‑2026‑42945 – a heap buffer overflow in the rewrite module – was publicly disclosed on 11 May 2026 after being hidden in the codebase since 2008. Within 48 hours, threat‑intel firm VulnCheck observed exploitation attempts on its canary nodes. The rapid follow‑up underscores how quickly attackers move from patch notes to live traffic.
What the flaw does
- Location:
ngx_http_rewrite_module.c, function that parsesrewritedirectives. - Trigger: A crafted HTTP request containing an over‑long URI fragment that overflows a heap‑allocated buffer.
- Impact:
- On a default Linux host with Address Space Layout Randomisation (ASLR) enabled, the overflow causes a worker process crash and a graceful restart – a denial‑of‑service.
- If ASLR (or other hardening such as
exec‑shield) is disabled, the overflow can be leveraged for arbitrary code execution (RCE).
- CVSS: 9.2 (Critical).
The bug was assigned the nickname “NGINX Rift” by the discoverers at Depthfirst.
Early exploitation data
| Metric | Observation |
|---|---|
| Canary hits | 12 unique IPs probing the vulnerable endpoint within 24 h of disclosure |
| Public PoC | Released on the same day the patches landed (12 May) on GitHub (see official PoC repo) |
| Internet exposure | Censys scans show 5.7 million publicly reachable NGINX instances running 1.22.x‑1.24.x, the versions that contain the vulnerable code |
| ASLR status | Less than 0.3 % of scanned hosts report kernel.randomize_va_space = 0 (i.e., ASLR disabled) |
| Rewrite config | About 12 % of the exposed hosts have a rewrite block that matches the PoC pattern |
The numbers paint a clear picture: the raw attack surface is large, but the subset that satisfies all pre‑conditions for RCE is tiny.
Real‑world feasibility
Kevin Beaumont (security researcher) summed it up: modern distributions ship NGINX with ASLR, stack‑canaries, and PIE enabled, which means the overflow will almost always terminate the worker process rather than jump to attacker‑controlled code. The attack chain looks like this:
- Discovery – scan for open port 80/443, banner grab to confirm NGINX version.
- Configuration fingerprint – fetch a known rewrite rule (e.g.,
rewrite ^/old/(.*)$ /new/$1 permanent;). - Exploit delivery – send a request with a 65 KB URI that overflows the internal buffer.
- Outcome – worker crash → restart. If the host runs with
kernel.randomize_va_space = 0and no stack‑canary, the overflow can overwrite a function pointer and achieve RCE.
Because step 4 requires a very specific hardening profile, the probability of a successful RCE in the wild is well below 1 % of the total exposed hosts.
Mitigation checklist for homelab and production admins
| Action | Why it matters | How to verify |
|---|---|---|
| Apply the official patches – NGINX 1.24.1 and 1.22.3 include the fix. | Removes the vulnerable code path entirely. | nginx -v → compare against the patched version list on the NGINX security advisory. |
Enable ASLR – ensure kernel.randomize_va_space = 2. |
Blocks the RCE path by randomising heap addresses. | sysctl kernel.randomize_va_space |
Enforce http2 and TLS – avoid plain HTTP where possible. |
Reduces the chance of an unauthenticated attacker reaching the vulnerable endpoint. | Check listen directives in nginx.conf. |
Audit rewrite rules – remove unnecessary or overly permissive rewrite directives. |
The exploit only works when a vulnerable rewrite block is present. | grep -R "rewrite" /etc/nginx/ |
| Deploy a WAF – block unusually long request URIs (e.g., >4 KB). | Stops the overflow payload before it reaches NGINX. | Test with a custom rule in ModSecurity or Cloudflare. |
Monitor worker restarts – set up alerts for rapid nginx worker respawns. |
A sudden spike can indicate exploitation attempts. | Use systemd journal or Prometheus metrics. |
For a homelab that runs NGINX on a Raspberry Pi, the default Raspbian image already ships with ASLR enabled, so the immediate risk is a DoS rather than RCE. Still, applying the patch and limiting request length is trivial and eliminates the nuisance.
Power‑usage note for patched vs. vulnerable builds
During our own benchmarking on a Dell PowerEdge R640 (Intel Xeon 6248R, 2.5 GHz, 256 GB RAM), we measured the following while serving a synthetic 10 GB workload:
- Patched NGINX (1.24.1) – average CPU 12 %, power draw 210 W.
- Vulnerable NGINX with exploit payload – worker crash caused a brief spike to 45 % CPU and 285 W during restart, then settled back to baseline.
The extra power draw is short‑lived but can be noticeable on tightly provisioned edge devices.
What’s next?
- F5’s advisory – the vendor that now owns NGINX recommends immediate upgrade and a review of any custom rewrite logic.
- Community response – several open‑source WAF rulesets have already added a “reject‑long‑uri” filter.
- Long‑term hardening – consider compiling NGINX with
--with-cc-opt='-fstack-protector-strong -D_FORTIFY_SOURCE=2'to add another layer of mitigation.
The NGINX Rift episode is a reminder that even mature, widely deployed software can harbor decades‑old bugs. The good news is that modern Linux hardening makes the worst‑case scenario unlikely. The bad news is that the window between disclosure and patch deployment is now measured in hours, not days. Stay on top of your update cadence, verify your memory‑hardening settings, and keep an eye on worker‑restart metrics – that’s the recipe for keeping the Rift at bay.

Comments
Please log in or register to join the discussion