Skip to content

queryDepth limit bypassed for WebSocket subscriptions

Moderate
mcollina published GHSA-m4h2-mjfm-mp55 Mar 6, 2026

Package

npm mercurius (npm)

Affected versions

< 16.8.0

Patched versions

>= 16.8.0

Description

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.

Severity

Moderate

CVE ID

CVE-2026-30241

Weaknesses

Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. Learn more on MITRE.

Credits