Skip to content

Defender Daily

NGINX HTTP/2 flaw that can run code without a login has a public exploit

Affected
nginx 1.9.5 through 1.30.6 and 1.31.0 through 1.31.8, plus NGINX Plus releases before the fixed 37.3 and 37.0 releases and R33 and later R releases. All versions and fixes

, an integer underflow in NGINX’s HTTP/2 flow control, lets an unauthenticated attacker corrupt memory and, under certain conditions, run code with a worker process’s permissions, Rapid7 says. Rapid7 found the flaw and published a working exploit. F5 also fixed , a second HTTP/2 flaw that can lead to code execution, among 10 flaws fixed in nginx 1.30.7 and 1.31.9. No attacks have been reported.

In HTTP/2, a client grants the server credit to send a set amount of data. When a client cancels a request whose response is still queued, NGINX hands the unused credit back without checking that the total stays under the protocol’s limit, Rapid7 says. A later calculation then wraps to a huge value, and NGINX copies a response with an invalid length. That can leak memory, crash the worker or, with more steps, run code.

Only configurations that use HTTP/2 are affected, F5 says. Rapid7’s exploit sends about 128 GB of HTTP/2 data, which takes about two minutes on a 10 Gbit/s link and 17 minutes on 1 Gbit/s. It can’t finish on links slower than about 300 Mbit/s, because NGINX closes connections after an hour by default. A proxy in front of NGINX would likely not pass on the exact frames it needs.

The exploit also depends on a glibc copy routine chosen on x86-64 processors with certain AVX-512 features. Other ways to run code may exist, but none are known, Rapid7 says.

is a use-after-free that F5 says affects NGINX when it accepts HTTP/2 from clients, proxies requests to a backend and runs low on worker connections. F5 says attackers can run code through either flaw where ASLR is turned off or can be bypassed. CISA rates neither flaw automatable.

NGINX Plus has fixed releases in its 37.3 and 37.0 lines. The fix table Rapid7 reproduces from F5 lists none for NGINX Plus R34 through R36, and F5’s CVE record shows R33 and later R releases affected with no fix.

CVE
Vendor
F5

What to do

3 steps

Affected and fixed versions

  • Product
    nginx mainline
    Affected
    1.31.0 through 1.31.8
    Fixed
    1.31.9
  • Product
    nginx stable and older
    Affected
    1.9.5 through 1.30.6
    Fixed
    1.30.7
  • Product
    NGINX Plus 37.1 and 37.2
    Affected
    Releases before the fixed 37.3 release
    Fixed
    The 37.3 release F5’s advisory lists
  • Product
    NGINX Plus 37.0
    Affected
    Releases before the fixed 37.0 release
    Fixed
    The 37.0 release F5’s advisory lists
  • Product
    NGINX Plus R releases
    Affected
    R33 and later, by F5’s CVE record
    Fixed
    None listed

Timeline

  1. Nov 11Rapid7 reports the flaw to F5.
  2. Nov 16F5 confirms the flaw, assigns its CVE ID and sets the disclosure date.
  3. Nov 18F5 releases nginx 1.30.7 and 1.31.9, and Rapid7 publishes its analysis and exploit.

Sources

Tags

Subscribe

Get the Daily Brief by email

Weekdays at 7am ET.

We’ll email you a link to confirm. Unsubscribe from any email.