Skip to main content
Menu
Advisories

Impact What kind of vulnerability is it

GHSA-38PJ-464P-88JFPublished Updated GitHub

Description

Impact

What kind of vulnerability is it? Who is impacted?

Denial of service through resource exhaustion (CWE-772 missing release of resource after effective lifetime, CWE-400)..

When the server initiates a WebSocket close (idle timeout, unsupported frame, or an unexpected error) it writes a Close frame and then, if the @ServerWebSocket bean has no @OnClose method, never closes the underlying connection. A client that ignores the Close frame keeps the connection, its session and its event-loop registration alive indefinitely, and each subsequent idle timeout writes another Close frame. micronaut.server.idle-timeout is therefore ineffective for such endpoints, and an attacker can accumulate connections until file descriptors or memory run out. In the other direction, a client-initiated close on an endpoint that does declare @OnClose is not echoed, which browsers report as an abnormal closure; this is a correctness issue rather than a security one.

Impacted: applications exposing a @ServerWebSocket without an @OnClose method.

Patches

Has the problem been patched? What versions should users upgrade to?

Patched in 3.10.16, 4.10.33 and 5.2.17. The server always closes the connection after its Close frame is written, or after a short forced-close timeout if the peer does not read it, and echoes a peer's Close frame before closing.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

  • Declare an @OnClose method on every @ServerWebSocket endpoint; with one present the connection is closed after the handler runs.
  • Enforce idle timeouts for WebSocket connections at a reverse proxy.

References

Are there any links users can visit to find out more?

Affected versions

References

GitHub · micronaut-projects/micronaut-core