GHSA-97XR-JCHP-XM3C
Directus public WebSocket clients gain unrestricted item access after a failed auth message
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
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-97XR-JCHP-XM3C divulgada · CVSS 9.2 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
When a Directus instance is configured for public WebSocket REST access, a failed `auth` message on an already connected socket replaces the client's public accountability with a null accountability and leaves the connection open. Null accountability is the state Directus reserves for trusted internal calls, and the service layer skips permission evaluation entirely when it is present. Every subsequent `items` message on that socket is therefore executed with no authorization check.
The result is that failing authentication grants more access than succeeding at it. An unauthenticated attacker who can reach the public WebSocket endpoint can deliberately submit an invalid token and then read, create, update, or delete records in any user-defined collection, regardless of the permissions granted to the public role.
Details
The WebSocket `items` handler passes the connected client's accountability directly into `ItemsService`. `ItemsService` only calls its access validation when an accountability object is present, so a null value bypasses the check rather than denying it.
Deletion by query is the highest impact action reachable this way, because a single attacker-supplied filter can select every row in a collection and Directus applies no batch mutation limit by default.
The same accountability transition also occurred when a public-mode client's access token expired without a successful re-authentication, so the vulnerable state is reachable without submitting a deliberately invalid token.
Directus system collections are rejected by the handler before the service call, so users, sessions, tokens, permissions, and other `directus_*` data are not reachable through this path. Impact is confined to user-defined collections.
Impact
Confidentiality, integrity, and availability of user-defined collection data are all affected. An unauthenticated network attacker gains unrestricted read and write access to that data, and can destroy arbitrary amounts of it in a single request. Configured query limits and `MAX_BATCH_MUTATION` reduce the blast radius on some deployments but are not authorization controls.
Credentials, session tokens, and permission configuration are not directly exposed, because system collections are out of reach on this path.
Affected configurations
An instance is affected only if all of the following hold:
- `WEBSOCKETS_ENABLED` is `true` (default: `false`)
- `WEBSOCKETS_REST_ENABLED` is `true` (default: `true` once WebSockets are enabled)
- `WEBSOCKETS_REST_AUTH` is `public` (default: `handshake`)
- the WebSocket endpoint is reachable by the attacker
Instances left on the default `handshake` or `strict` WebSocket authentication modes close the socket immediately on authentication failure, which removes the unauthenticated attack path.
Patches
Fixed in Directus `12.1.0` (`@directus/api` `37.0.0`). Authentication failure and token expiry now retain a public-role accountability object instead of clearing it, in every WebSocket authentication mode. Upgrade to `12.1.0` or later.
Workarounds
If you cannot upgrade immediately, set `WEBSOCKETS_REST_AUTH` to `handshake` or `strict`, or set `WEBSOCKETS_ENABLED=false` to disable the WebSocket endpoints.
Credits
Reported by @JacobBrackett.
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-97xr-jchp-xm3cLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
