NGINX HTTP/2 flaw that can run code without a login has a public exploit
- Affected
- nginx
1.9.5through1.30.6and1.31.0through1.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
- CVE
- Vendor
- F5
, 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 | Affected | Fixed |
|---|---|---|
| nginx mainline | 1.31.0 through 1.31.8 | 1.31.9 |
| nginx stable and older | 1.9.5 through 1.30.6 | 1.30.7 |
| NGINX Plus 37.1 and 37.2 | Releases before the fixed 37.3 release | The 37.3 release F5’s advisory lists |
| NGINX Plus 37.0 | Releases before the fixed 37.0 release | The 37.0 release F5’s advisory lists |
| NGINX Plus R releases | R33 and later, by F5’s CVE record | None listed |
- Product
- nginx mainline
- Affected
1.31.0through1.31.8- Fixed
1.31.9
- Product
- nginx stable and older
- Affected
1.9.5through1.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
- Nov 11Rapid7 reports the flaw to F5.
- Nov 16F5 confirms the flaw, assigns its CVE ID and sets the disclosure date.
- Nov 18F5 releases nginx
1.30.7and1.31.9, and Rapid7 publishes its analysis and exploit.
Sources
- Rapid7 researchPrimary source rapid7.com
- F5 advisory for the flow control flawPrimary source my.f5.com
- F5 advisory for the use-after-freePrimary source my.f5.com
- CVE record for the flow control flawPrimary source cve.org
- CVE record for the use-after-freePrimary source cve.org
- nginx advisoryPrimary source nginx.org
- nginx noticePrimary source nginx.org