Micronaut HTTP/2 server leaks buffered request data when a stream is reset
Description
Impact
What kind of vulnerability is it? Who is impacted?
Denial of service through memory exhaustion (CWE-401 missing release of memory, CWE-400 uncontrolled resource consumption)..
The HTTP/2 server handler can retain request DATA frames while waiting for the end of a read cycle before dispatching the request. If a client resets the stream (RST_STREAM) before that point, the retained frames are not released. Repeated resets can leak pooled direct memory and eventually exhaust the allocator, causing the server to stop serving requests.
Impacted: any application that enables HTTP/2 on the Netty server (micronaut.server.http-version: 2.0, including h2c). Applications that serve only HTTP/1.1 are not affected. No authentication or specific route is required; the attack works against any path.
Patches
Has the problem been patched? What versions should users upgrade to?
The buffered-frame issue is patched in 3.10.13, 4.10.30, and 5.2.2. The fixes release buffered request data when a stream is reset. There is no corresponding fix in 5.1.x; users on 5.1.x should upgrade to 5.2.2 or later.
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
- Disable HTTP/2 on the Micronaut listener (
micronaut.server.http-version: 1.1, the default) and terminate HTTP/2 at a reverse proxy that speaks HTTP/1.1 to the application. - There is no configuration that bounds the leak while HTTP/2 stays enabled;
max-request-sizeand flow-control windows do not apply because the window is returned to the client when the stream closes.
References
Are there any links users can visit to find out more?
- github.com/
micronaut-projects/ micronaut-core/ security/ advisories/ GHSA-xxxx - docs.micronaut.io/
latest/ guide/ #http2Server - RFC 9113 section 5.1 (stream states) and 6.4 (RST_STREAM)