# NGINX Heap Overflow (CVE-2026-42533) Is Worse Than F5's Advisory Lets On


## The Threat


There is a heap buffer overflow in NGINX's script engine that a remote, unauthenticated attacker can trigger with a crafted HTTP request. F5 patched it on July 15 and rated it 9.2 on CVSS v4 — but the advisory's framing of code execution as a conditional risk, gated on ASLR being disabled, has already drawn pushback from one of the researchers who found it.


The bug lives in how NGINX assembles dynamic strings at request time. The engine makes two passes over an expression: the first measures how many bytes the result needs and allocates a buffer; the second writes the bytes in. Both passes pull from the same shared capture state. The problem appears when a regex-based map directive sits between those two passes — evaluating the map's regex overwrites the capture state the engine is still using. The measuring pass sizes the buffer for the original capture ($1 from your location regex, say), but by the time the writing pass runs, a different, attacker-influenced capture has replaced it. The buffer is too small, and both the length and the contents of the overrun come directly from the request.


That setup is specific — you need a regex map whose output variable appears in a string expression that also references a numbered capture from an earlier regex match. Not every NGINX deployment has that pattern. But Stan Shaw, publishing as *cyberstan*, argues the flaw is nastier than the advisory implies: when the clobbered capture is *smaller* than the original, the oversized buffer returns uninitialized heap data. On a default Ubuntu 24.04 build, he says a single unauthenticated GET is enough to recover the addresses needed for a payload — meaning the overflow is not just a DoS risk on standard systems, it is the ASLR bypass. F5 did not make that case.


## Severity and Impact


| Field | Detail |

|---|---|

| CVE | CVE-2026-42533 |

| CVSS v4 Score | 9.2 (Critical) |

| CVSS v3.1 Score | 8.1 (High) |

| Attack Complexity | High |

| Authentication Required | None |

| Attack Vector | Network (remote, unauthenticated) |

| Impact | Worker crash (DoS); potential RCE where ASLR is disabled or bypassable |

| Vulnerability Type | Heap Buffer Overflow |

| Vulnerable Since | nginx 0.9.6 (2011, when map gained regex support) |


## Affected Products


Core server and Plus:

  • nginx stable: 0.9.6 through 1.30.3 — fixed in 1.30.4
  • nginx mainline: 0.9.6 through 1.31.2 — fixed in 1.31.3
  • NGINX Plus: through R37 — fixed in R37.0.3.1

  • Additional F5 products (fixed builds not listed at publication):

  • NGINX Ingress Controller
  • NGINX Gateway Fabric
  • NGINX App Protect WAF
  • NGINX Instance Manager

  • Organizations running any of those four products should watch F5's advisory page for updated build numbers; F5 had not published them when this article went to press.


    ## Mitigations


    Upgrade. The only complete fix is nginx 1.30.4, nginx 1.31.3, or NGINX Plus R37.0.3.1. F5's advisory does not carry ambiguity on this point, and neither does Shaw.


    Temporary workaround — with a caveat. F5's documented workaround is to convert affected numbered captures in map directives to named captures. Shaw confirms this closes the primary code path and covers most configurations. However, he identified a second path: a map that defines the same named group as the location regex reaches the same overflow through different code. F5's advisory does not address this second path. If you cannot patch immediately, apply the named-capture workaround — but treat it as a stopgap, not a resolution, and escalate the patch.


    Configuration audit. The vulnerable pattern is: a regex map directive whose output variable is referenced in a string expression that also includes a numbered capture ($1, $2, etc.) from an earlier regex location match. Audit your NGINX configs for this combination. If you do not have it, you are not exposed through this specific bug — but you should still upgrade.


    Network controls. For deployments where patching will take time, consider whether the affected services can be placed behind rate limiting or access controls that reduce anonymous request volume. This reduces DoS risk; it does not close the RCE path if Shaw's findings hold.


    NGINX Ingress / Gateway Fabric users. If you are running NGINX in Kubernetes through the Ingress Controller or Gateway Fabric, watch F5's channel closely. The absence of fixed builds for these products at patch time is a gap, and cloud-native deployments of NGINX are common enough that this is not an edge case.


    ## References


  • [F5 Security Advisory — CVE-2026-42533](https://my.f5.com/manage/s/article/K000150900)
  • [nginx changelog — 1.30.4 / 1.31.3](https://nginx.org/en/CHANGES)
  • [Stan Shaw (cyberstan) — detailed writeup](https://cyberstan.io)
  • [NGINX Plus R37.0.3.1 release notes](https://docs.nginx.com/nginx/releases/)

  • ---


    ## HackWire Analysis


    The most important thing about CVE-2026-42533 is not the score. It is the gap between what the vendor's advisory says and what independent researchers are saying — and that gap matters operationally.


    F5 frames code execution as conditional on ASLR being disabled or bypassed. That framing is technically accurate but functionally misleading if Shaw's analysis is right: he is arguing that the vulnerability itself provides the bypass, by leaking uninitialized heap memory when the capture clobber goes in the opposite direction. He says this worked in 10 of 10 tests on default Ubuntu 24.04. That is a claim that makes this a practical RCE vulnerability on commodity Linux infrastructure, not a theoretical one. He is withholding the proof-of-concept, so independent verification is not yet possible — but the mechanism he describes is coherent, and the fact that F5 did not address the named-capture second path in their own advisory suggests the research is ahead of what the vendor has fully characterized.


    The vulnerability reaching back to 0.9.6 (2011) is also worth pausing on. Fifteen years of versions exposed, reported independently by over a dozen researchers arriving at the same finding at roughly the same time. When that happens, the question is always whether someone found it first and kept quiet. There is no evidence of active exploitation, but the combination of a long exposure window, a common deployment pattern (regex maps are not exotic), and a disputed-but-plausible RCE path makes this a patch-now situation, not a schedule-it-for-next-cycle one.


    Defenders should be especially skeptical of the named-capture workaround. It is not wrong — it does close the main path — but publishing a mitigation that a researcher has already shown is incomplete is the kind of thing that gives organizations false confidence during the window before a patch is deployed.


    — HackWire Editorial


    ---


    ## Related Coverage


  • Read more in our [Vulnerabilities](https://www.hackwire.news/category/vulnerabilities) coverage
  • Cross-reference with [Breaches](https://www.hackwire.news/category/breaches) and [Malware](https://www.hackwire.news/category/malware)
  • Stay current via the [HackWire homepage](https://www.hackwire.news/)