Assertion failed in node::http2::Http2Session::~Http2Session() leads to HTTP/2 server crash
A race condition in Node.js HTTP/2 session teardown can leave header data in nghttp2 memory when a client sends CONTINUATION frames and then abruptly closes the TCP connection. An attacker could crash the HTTP/2 server with a small number of frames, making it unavailable.
- Triaged in 24 hours
- Fixed in 21 days
- Paid in 21 days
- Disclosed after 21 days
Summary by the program
Assertion failed in node::http2::Http2Session::~Http2Session() leads to HTTP/2 server crash (CVE-2024-27983) - (High) An attacker can make the Node.js HTTP/2 server completely unavailable by sending a small amount of HTTP/2 frames packets with a few HTTP/2 frames inside. It is possible to leave some data in nghttp2 memory after reset when headers with HTTP/2 CONTINUATION frame are sent to the server and then a TCP connection is abruptly closed by the client triggering the Http2Session destructor while header frames are still being processed (and stored in memory) causing a race condition.
Impacts:
This vulnerability affects all users in all active release lines: 18.x, 20.x and, 21.x.
Thank you, to bart for reporting this vulnerability and Anna Henningsen for fixing it.
Full Security Advisory: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases
The report
An attacker can make the Node.js HTTP/2 server completely unavailable by sending a small amount of HTTP/2 frames packets with a few HTTP/2 frames inside. It is possible to leave some data in nghttp2 memory after reset when headers with HTTP/2 CONTINUATION frame are sent to the server and then a TCP connection is abruptly closed by the client triggering the Http2Session destructor while header frames are still being processed (and stored in memory) causing a race condition.
- Advisory: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases
- HackerOne report: 2319584
Impact
Server crashes instantly after sending a few HTTP/2 frames.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a race between processing HTTP/2 header frames and destroying the session when the TCP connection closes, leaving data in nghttp2 memory that the destructor does not expect.
Impact
The HTTP/2 server crashes instantly, making it completely unavailable to all users.
What the attacker needed
Target runs Node.js 18.x, 20.x or 21.x; target exposes an HTTP/2 server; attacker can send TCP packets to it
The fix
A fix was credited to Anna Henningsen, with an April 2024 security advisory.
How it was found
- Send HTTP/2 headers that include a CONTINUATION frame to the server.
- Abruptly close the TCP connection from the client.
- The server's Http2Session destructor runs while header frames are still being processed, causing a crash.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
HTTP/2 is a newer version of the protocol web servers use to talk to browsers. A race condition means two things happen at almost the same time and the program handles them in the wrong order. Here, if a client sends part of a request and then disconnects suddenly, the server can crash while cleaning up, so other users cannot reach it.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.