Skip to main content
Menu
Advisories

Micronaut WebSocket server lacks inbound backpressure and decompression limits and leaks fragmented ByteBuf messages

GHSA-973F-VVMG-R76VPublished Updated GitHub

Description

A WebSocket peer can exhaust server memory or event-loop capacity in several ways: permessage-deflate (negotiated by default) inflates frames without a cap, defeating maxPayloadLength (observed 256x amplification); @ServerWebSocket beans apply no inbound read or concurrency backpressure, so messages are dispatched without bound; every ping is answered with a pong while reading continues, so a non-reading peer grows server outbound memory with its upload, also after WebSocketSession.close(); and fragmented messages delivered to a ByteBuf @OnMessage handler leak the reassembled payload. broadcastSync/sendSync block on the event loop and can deadlock it, a broadcast write failure closes the sender, and the WebSocket client leaks connections when extension negotiation fails. An unauthenticated client of any WebSocket endpoint can cause denial of service. The fix is to bound inflated size, stop reading while handler dispatch or outbound data is pending, stop reading after close, release reassembled buffers, and keep blocking APIs off the event loop.

Affected and patched versions

PackageAffected versionsPatched version
io.micronaut:micronaut-http-netty< 3.10.193.10.19
io.micronaut:micronaut-http-netty>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-http-netty>= 5.0.0, < 5.2.235.2.23
io.micronaut:micronaut-http-server-netty< 3.10.193.10.19
io.micronaut:micronaut-http-server-netty>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-http-server-netty>= 5.0.0, < 5.2.235.2.23
io.micronaut:micronaut-websocket< 3.10.193.10.19
io.micronaut:micronaut-websocket>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-websocket>= 5.0.0, < 5.2.235.2.23
io.micronaut:micronaut-http-client< 3.10.193.10.19
io.micronaut:micronaut-http-client>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-http-client>= 5.0.0, < 5.2.235.2.23

The 3.x fix is in commit 8990b0979c, first included in stable release 3.10.19. The last affected stable 3.10.x release is 3.10.18.

Findings

  • F02
  • F03 (= ANT-2026-VGGGQBL1)
  • F16 (= ANT-2026-EW0ZQXVE)
  • F33 (= ANT-2026-550WOTB9)
  • ANT-2026-L0JZE30L
  • ANT-2026-WCRIJCEK
  • ANT-2026-C4EWJVRX
  • ANT-2026-GZ15ZNU2

Affected versions

References

GitHub · micronaut-projects/micronaut-core