Mercurius's queryDepth limit bypassed for WebSocket subscriptions
Description
Published to the GitHub Advisory Database
Mar 6, 2026
Reviewed
Mar 6, 2026
Published by the National Vulnerability Database
Mar 6, 2026
Last updated
Mar 9, 2026
Description
Mercurius fails to enforce the configured queryDepth limit on GraphQL subscription queries received over WebSocket connections. The depth check is correctly applied to HTTP queries and mutations, but subscription queries are parsed and executed without invoking the depth validation. This allows a remote client to submit arbitrarily deeply nested subscription queries over WebSocket, bypassing the intended depth restriction. On schemas with recursive types, this can lead to denial of service through exponential data resolution on each subscription event.
Workarounds
Disable subscriptions and, in general, queries over the WebSocket.
References