Skip to main content
Menu
Advisories

Micronaut Netty server leaks response buffers, streams and compressors when a client disconnects or a body is not written

GHSA-5G2V-X779-WR6WPublished Updated GitHub

Description

Response bodies are not reliably released when the client goes away. ByteBuf items dropped after a disconnect are never released because discard only closes CloseableByteBody (variant of GHSA-q5pv-9g2c-cv44); ConcatenatingSubscriber attaches a piece that arrives after allowDiscard and never discards it, leaving InputStream/file bodies open; NettyByteBodyFactory.toStreaming has no discard callback, so proxied response bodies leak on early disconnect; HEAD requests to routes returning a ByteBody never release it; and queued pipelined responses each hold a native Deflater. An unauthenticated client can exhaust direct and native memory or file handles by repeatedly disconnecting from streaming routes. The fix is to discard every response piece, including late and unopened ones, on cancel or HEAD.

Affected

All released 5.2.x versions (<= 5.2.16).

Findings

  • F17
  • F48
  • ANT-2026-DPNN0FMX
  • ANT-2026-N2VYX5CK
  • ANT-2026-8T2OOKIO

Note

Hardening note (not a confirmed member): ANT-2026-AG4NOG97, the off-event-loop demand accounting bug in ConcatenatingSubscriber reproduces at unit level (ConcatenatingSubscriberDemandTest), but the claimed end-to-end memory DoS did not (25-29k buffered rows vs the claimed 0.6-1.3M). Fix it with this group without claiming impact. Worst case unchanged (5.9).

Affected versions

References

GitHub · micronaut-projects/micronaut-core