NGINX fixes `ngx_http_rewrite_module` heap overflow with possible RCE
Patch & Detection Intelligence · 4 sources · Updated 5mo ago · First seen Dec 25, 2025

NGINX released versions 1.31.1 and 1.30.2 to fix CVE-2026-9256, a heap buffer overflow in ngx_http_rewrite_module that can be triggered by unauthenticated attackers with specially crafted HTTP requests. The flaw affects NGINX Open Source and NGINX Plus when rewrite directives use overlapping or nested PCRE capture groups and replacement strings that reference multiple captures in redirect or arguments contexts, creating memory corruption in the worker process. Successful exploitation can force worker restarts and denial of service, and may lead to arbitrary code execution if protections such as ASLR are absent or bypassed; NGINX described the issue as a data plane exposure with no control plane impact.
Why it matters
Impact assessment
NGINX Open Source and NGINX Plus deployments are affected if they use vulnerable rewrite rules in ngx_http_rewrite_module, especially internet-facing reverse proxies and web applications that process untrusted HTTP requests. The immediate impact is worker-process crashes and denial of service; under weaker memory-protection conditions such as disabled or bypassed ASLR, the flaw may also enable remote code execution in the worker process.
The exposure appears technically serious but likely configuration-dependent rather than universally widespread. Public-repository scanning of 35,633 parseable NGINX configurations found mostly proofs of concept, tutorials, and test fixtures, with only one real vulnerable public configuration identified, but private enterprise configurations may still contain the same risky rewrite patterns.
Supporting facts
- Affected products: NGINX Open Source and NGINX Plus.
- Fixed versions: 1.31.1 and 1.30.2.
- Impacted component: ngx_http_rewrite_module in the data plane.
- Control plane impact: none stated by NGINX/F5.
- Attack precondition: vulnerable rewrite directives using overlapping or nested PCRE capture groups with multiple capture references in redirect or arguments contexts.
- Exploitation status: no confirmed in-the-wild exploitation reported in the provided sources.
- Exposure scope: likely targeted and configuration-specific, not broadly exploitable across default deployments.
- Public prevalence finding: one real vulnerable public configuration identified in point/cassea; most other hits were non-production examples.


