# CVE-2026-9256: NGINX rewrite heap overflow crashes workers, may allow code execution

A heap overflow in NGINX's rewrite module lets an unauthenticated attacker crash worker processes with crafted requests, and possibly run code if ASLR is off or bypassed. No exploitation in the wild is confirmed and no working public exploit is confirmed.

- Vendor: F5, NGINX rewrite module (NGINX Plus and NGINX Open Source)
- Severity: CRITICAL (CVSS 4.0 9.2)
- Exploited (CISA KEV): not listed
- EPSS: 8.3% on 2026-12-02
- Public exploit: none reported
- Patch available: yes
- Vendor advisory: K000161377, https://my.f5.com/manage/s/article/K000161377
- Published: 2026-05-22; updated: 2026-10-26
- Page: https://patchtonight.com/cve/CVE-2026-9256/

## Affected and fixed versions

| Affected | Fixed in |
| --- | --- |
| NGINX Plus 37.0 | 37.0.1.1 or later |
| NGINX Plus R36 | R36 P5 or later |
| NGINX Plus R32 | R32 P7 or later |
| NGINX Open Source 1.31.0 | 1.31.1 or later |
| NGINX Open Source 1.30.0 and 1.30.1 | 1.30.2 or later |
| Older NGINX Open Source (0.1.17 up to the 1.30 branch) | Upgrade to a fixed release. The CVE record lists 0.1.17 to 0.9.7 only; nginx.org lists 0.1.17 through 1.31.0 |

## What it is

NGINX's `ngx_http_rewrite_module` has a **heap buffer overflow**. It triggers when a `rewrite` directive uses a regex with several unnamed, overlapping PCRE captures, and the replacement uses more than one of them (for example `$1$2`) in a redirect or arguments context.

An unauthenticated attacker sends crafted HTTP requests. The usual result is a crash of the NGINX worker process, which restarts: a denial of service if repeated. F5 says **code execution is possible where ASLR is disabled or can be bypassed**. Success depends on conditions the attacker doesn't control. Only the data plane is affected, not the control plane.

The CVSS 4.0 score is 9.2 (critical), with high attack complexity and a "present" attack requirement. nginx.org rates it medium, and Red Hat's CVSS 3.1 score is 8.1. EPSS is 11% (96th percentile) as of October 25, 2026.

It is **not in CISA's KEV catalog** (catalog 2026.10.23), and we found no report of exploitation. Some aggregator pages tag it "exploited" or "proof of concept". Their own text gives no evidence for that, so we treat both as unconfirmed. One listing describes a scanner that only reads local config for risky rewrite rules.

## Am I affected?

You're exposed if **both** are true:

1. You run an affected version (table above).
2. Your configuration has a `rewrite` rule whose regex has multiple unnamed captures and whose replacement references more than one of them in a redirect or arguments context. A typical shape is:

```
rewrite ^/users/([0-9]+)/profile/(.*)$ /profile.php?id=$1&tab=$2 last;
```

Check your version with `nginx -v`. Search your whole config, including included files, for `rewrite` directives:

```
nginx -T | grep -n "rewrite "
```

Look for ones with two or more `( )` groups used in the replacement. Rules with named captures, or that use only one capture, don't match the description in the CVE record. Treat that as guidance, not proof: we could not open the F5 advisory to confirm the exact conditions.

F5 did not evaluate versions past End of Technical Support.

## What to do

1. **Upgrade.** NGINX Open Source: 1.31.1 or 1.30.2, or later. NGINX Plus: 37.0.1.1, R36 P5 or R32 P7, or later. If you use a distribution package, check your vendor's advisory (Red Hat and Debian LTS have published fixes).
2. **If you can't upgrade tonight**, apply the workaround in the CVE record: **use named captures instead of unnamed ones** in rewrite rules, then reload. For example:

```
rewrite ^/users/(?<user_id>[0-9]+)/profile/(?<section>.*)$ /profile.php?id=$user_id&tab=$section last;
```

   This is a config-only change, but test it first. The oss-security post mentions no workaround.
3. **Check that ASLR is on** for the host. It is the main barrier between a crash and code execution.
4. **If a vulnerable, internet-facing rule was live**, review the logs below. Treat unexplained worker crashes as a possible exploit attempt, not just instability.

## Detection

No indicators of compromise have been published. Look for the crash pattern:

- Repeated `worker process ... exited on signal 11` (or other signals) in the NGINX error log, with new worker processes starting right after.
- Requests in the access log that match your risky rewrite rules (unusual, very long or odd-looking URIs) just before a crash.
- Unexpected child processes or outbound connections from the NGINX user on the host.

## Sources

- [F5 advisory K000161377](https://my.f5.com/manage/s/article/K000161377)
- [CVE record (CVE Program)](https://cveawg.mitre.org/api/cve/CVE-2026-9256)
- [nginx.org security advisories](https://nginx.org/en/security_advisories.html)
- [oss-security announcement](http://www.openwall.com/lists/oss-security/2026/05/22/14)

---

Data from PatchTonight (https://patchtonight.com), compiled from vendor advisories, CISA KEV and FIRST EPSS. Please credit PatchTonight and link to the CVE page when you use it.
