GHSA-FF8W-8CRV-9RCF
Resource exhaustion via unbounded GraphQL documents on the WebSocket endpoint
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 12.1.0 | directus · -35 d desde divulgación | |
| Divulgación | Publicada | GHSA-FF8W-8CRV-9RCF divulgada · CVSS 6.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The GraphQL WebSocket endpoint did not apply the parser and validation limits that guard the HTTP GraphQL endpoint.
Documents arriving over the WebSocket transport were parsed without the `GRAPHQL_QUERY_TOKEN_LIMIT` bound. Because that
transport accepts `query` and `mutation` operations alongside subscriptions, an ordinary query with deeply nested
relational fields could be executed there without the document size ceiling that applies over HTTP, expanding a single
client message into a disproportionate amount of server side work.
Details
The HTTP GraphQL endpoint parses incoming documents through a middleware that enforces `GRAPHQL_QUERY_TOKEN_LIMIT`,
capping document size before any execution work begins. The WebSocket transport did not route through that middleware
and supplied no equivalent bound of its own, so document size and nesting depth were effectively unbounded on that path.
Two consequences follow. The cost of parsing, validating, and executing a single client message was unbounded. And
because relational fields can be nested repeatedly, each additional level multiplies the underlying database work, so
one message can expand into a large number of queries and hold database connections for its duration.
The same transport also did not honour `GRAPHQL_INTROSPECTION=false`, leaving introspection and validation field hints
available over WebSockets on instances that had disabled them over HTTP. The WebSocket GraphQL schema is scoped to user
defined collections and generated against the connected client's own permissions, so this revealed no more of the schema
than that client was already entitled to see. It is a hardening parity gap rather than an information disclosure.
Amplification depends on the deployed data model: nesting deeply requires user defined collections with cyclic or self
referencing relations. System collections are absent from this schema, so `directus_*` data and system mutations are not
reachable over this transport.
Impact
Availability. A client that can reach the GraphQL WebSocket endpoint can consume CPU, memory, and database connections
out of proportion to the size of its request, degrading or exhausting the API for other users. In the default
authentication mode the client must present a valid access token, so exploitation is limited to authenticated users.
Confidentiality and integrity are not affected.
Affected configurations
An instance is affected only if all of the following hold:
- `WEBSOCKETS_ENABLED` is `true` (default: `false`)
- `WEBSOCKETS_GRAPHQL_ENABLED` is `true` (default: `true` once WebSockets are enabled)
- the WebSocket GraphQL endpoint is reachable by the attacker
Exposure is wider where `WEBSOCKETS_GRAPHQL_AUTH` is set to `public` (default: `handshake`), since the endpoint is then
reachable without a token, but only to the extent that the public role has read access to related collections.
Patches
Fixed in Directus `12.1.0` (`@directus/api` `37.0.0`). The WebSocket transport now parses documents under
`GRAPHQL_QUERY_TOKEN_LIMIT` and validates them against the same shared rule set as the HTTP endpoint, including the
introspection settings, so the two transports enforce the same protections. Upgrade to `12.1.0` or later.
Workarounds
If you cannot upgrade immediately, set `WEBSOCKETS_GRAPHQL_ENABLED=false`, or `WEBSOCKETS_ENABLED=false` to disable all
WebSocket endpoints.
Credits
Reported by ProScan AppSec (https://proscan.one).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmdirectus |
Corregida | 12.1.0 | -35 d | 12.6.1 no afectada |
12.1.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/directus/directus/security/advisories/GHSA-ff8w-8crv-9rcfLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
