FALCONINTERNET

CVE-2026-42533: The 15-Year NGINX Flaw That Hands Attackers Your Web Server

Security
CVE-2026-42533: The 15-Year NGINX Flaw That Hands Attackers Your Web Server

NGINX, the web server powering roughly a third of the internet's public-facing infrastructure, shipped emergency patches on July 15 to close a heap buffer overflow that a researcher has now demonstrated is reliably weaponizable — without authentication, without a login, and without a working ASLR bypass, because the bug supplies its own.

CVE-2026-42533 carries a CVSS v4.0 score of 9.2 (Critical) and a CVSS v3.1 score of 8.1. It affects every nginx release from 0.9.6 through 1.30.3 (stable) and through 1.31.2 (mainline), plus NGINX Plus R33 through R36 and versions 37.0.0.1 through 37.0.2.1. That covers roughly 15 years of releases — every version shipped since March 2011, when nginx gained regex support in its map directive and quietly introduced the flaw.

How the Bug Works

nginx evaluates configuration directives at request time using a two-pass script engine: pass one measures the output buffer size required; pass two writes the data. The problem surfaces in a specific combination: a regex-based map directive whose output variable appears in a string expression that also references a regex capture from an earlier match — a $1 or named capture group from a location block, rewrite rule, if block, or similar.

When nginx evaluates the map variable during pass one, it overwrites the request object's stored capture state. So when pass two goes to write the data, it has more to write than the buffer measured in pass one. That mismatch is the overflow — and because the overflow content and size are both derived from the incoming HTTP request, an attacker controls both. The list of directives that can trigger it reads like a standard reverse-proxy config: proxy_pass, proxy_set_header, fastcgi_param, add_header, rewrite, grpc_set_header, uwsgi_param, and others.

Denial of Service Today, Possibly Code Execution Tomorrow

The guaranteed, immediate impact is a worker crash. nginx restarts dead workers automatically, so in practice the outward sign is sporadic 502 and 504 errors under attacker-controlled load — easy to misread as a traffic spike or a resource exhaustion problem. The more serious risk is remote code execution.

Researcher Stan Shaw, who found and reported the flaw, argues that the overflowing buffer exposes uninitialized heap data, which effectively functions as its own ASLR bypass: a single unauthenticated GET request can be crafted to leak heap pointer values, removing the last conventional barrier to full RCE. In his lab testing on Ubuntu 24.04 with ASLR fully enabled, exploitation succeeded 10 out of 10 times. F5 (NGINX's owner) describes the RCE risk as conditional on ASLR being disabled or bypassed — Shaw's claim is that the bug provides the bypass itself. Until a full technical writeup is available, treating it as a practical RCE risk is the prudent posture.

Shaw is withholding the proof-of-concept for 21 days post-patch, placing the public release around August 5–6, 2026. After that date, expect automated scanners to start looking for the vulnerable configuration pattern within hours.

Worth noting: this is the third heap overflow discovered in nginx's two-pass expression evaluator in approximately two months, following CVE-2026-42945 in May and a related issue shortly after. The underlying architectural weakness — a buffer measurement that does not account for state changes between its own two passes — appears to have produced multiple independently discoverable bugs. That is a pattern worth watching.

Are You Affected?

Two conditions must both be true. First, you must be running nginx 0.9.6 through 1.30.3 (stable) or through 1.31.2 (mainline). Second, your configuration must combine a regex-based map block with a string expression that references both a regex capture and the map output variable in the same directive.

Audit your nginx configs — /etc/nginx/nginx.conf and any files pulled in via include — for this pattern: a map block whose key uses a regex (a value starting with ~), whose output variable then appears alongside a positional capture ($1, $2) or named group in directives like proxy_pass, proxy_set_header, add_header, or similar. If you're not using regex-based map blocks at all, you are not in scope for this specific bug — but patching is still the right move given the track record of this code path.

How to Patch

  • nginx stable: update to 1.30.4
  • nginx mainline: update to 1.31.3
  • NGINX Plus: update to 37.0.3.1 (also documented as R36 P7)

On Debian/Ubuntu: apt update && apt install nginx. On RHEL, Rocky, or AlmaLinux: dnf update nginx. Confirm the result with nginx -v. If you are managing nginx through a hosting control panel — cPanel, Plesk, or DirectAdmin all distribute their own nginx packages, sometimes separately from the OS package manager — check for platform-level updates as well, since those packages may not be touched by a standard OS upgrade.

If immediate patching is not possible, switching regex-based map captures to named groups closes the primary attack vector but leaves a narrower secondary path open through named groups matching location regex captures. That partial mitigation buys time but is not a substitute for the patch, and the two-week PoC countdown makes the window for manual workarounds short.

Why This Matters Beyond Your nginx.conf

nginx's 33% web server market share (W3Techs, July 2026) understates its actual reach. Across managed hosting, cloud platforms, and self-hosted stacks, nginx frequently runs as a reverse proxy, SSL terminator, or load balancer in front of application code — invisible in server surveys but handling every inbound HTTP request before any application logic runs. CVE-2026-42533 sits directly in that path, triggered by request data, requiring no credentials and no prior foothold.

The PoC clock is running. Auditing nginx versions and rolling patches to configuration-managed servers is the kind of maintenance that usually waits for a change-control window; this one does not have that luxury. We track nginx version exposure across managed servers as a routine health check — and this week, that routine is earning its keep.

Need this handled instead of explained?

We do this for a living — talk to an engineer about your setup.