CVE-2026-30241

Mercurius: queryDepth limit bypassed for WebSocket subscriptions

Published Mar 6, 2026 CVSS 4.0 · 2.7 Low EPSS < 1% KEV · Not listed
Description
Mercurius is a GraphQL adapter for Fastify. Prior to version 16.8.0, 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. This issue has been patched in version 16.8.0.

Analysis

AI-generated

Technical impact

Mercurius is a GraphQL adapter for Fastify that enforces a queryDepth limit on client requests. Prior to version 16.8.0 the limit is applied to HTTP queries and mutations but is omitted for subscription queries received via WebSocket. An attacker can send a subscription with arbitrary nesting depth, causing the server to resolve deeply nested fields for every subscription event. This leads to a denial‑of‑service condition due to exponential data resolution when the schema contains recursive types.

Affected Systems

The issue affects Mercurius version 16.7.x and earlier. Any deployment using the mercurius npm package via Node.js that serves GraphQL subscriptions over WebSocket is vulnerable until the vendor releases version 16.8.0.

Risk and Exploitability

The CVSS score is 2.7, indicating low severity, implying a very small likelihood of exploitation in the wild. The EPSS score is less than 1%, indicating a very low probability of exploitation in the wild. The flaw can be exploited remotely by any client that can establish a WebSocket connection to the GraphQL endpoint; the injection of deeply nested subscription queries is the likely attack vector. Since the vulnerability is limited to subscription operations on WebSocket, an attacker needs prior access to a WebSocket‑enabled GraphQL server.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Mercurius to version 16.8.0 or later.
  • Configure a stricter queryDepth limit for subscription queries, ensuring validation is enforced.
  • Monitor subscription activity and system resource usage for abnormal spikes; consider rate‑limiting WebSocket subscriptions.

Generated by OpenCVE AI on April 18, 2026 at 09:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-m4h2-mjfm-mp55 Mercurius's queryDepth limit bypassed for WebSocket subscriptions
History
Type Values Removed Values Added
First Time appeared Mercurius Project
Mercurius Project mercurius
CPEs cpe:2.3:a:mercurius_project:mercurius:*:*:*:*:*:node.js:*:*
Vendors & Products Mercurius Project
Mercurius Project mercurius
Metrics cvssV3_1

{'score': 8.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Mercurius-js
Mercurius-js mercurius
Vendors & Products Mercurius-js
Mercurius-js mercurius
Type Values Removed Values Added
Description Mercurius is a GraphQL adapter for Fastify. Prior to version 16.8.0, 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. This issue has been patched in version 16.8.0.
Title Mercurius: queryDepth limit bypassed for WebSocket subscriptions
Weaknesses CWE-863
References
Metrics cvssV4_0

{'score': 2.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:U'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 9, 2026, 8:54 PM
Reserved
Mar 4, 2026, 5:23 PM
Status
Analyzed
Published
Mar 6, 2026, 10:16 PM
Modified
Jun 17, 2026, 10:32 AM