CVE-2026-30241: Mercurius's queryDepth limit bypassed for WebSocket subscriptions
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.
Published Mar 6, 2026 · Updated Mar 9, 2026
Affected packages
mercurius
- Ecosystem
- npm
- Affected
- < 16.8.0
- Fixed in
- 16.8.0
- Check
npm ls mercurius
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to TinkAnet, mcollina.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
