All vulnerabilities

Servers and applications

GHSA-mww8-4gwh-rjfw

Missing Origin validation on WebSocket upgrades allows Cross-Site WebSocket Hijacking

Severity
High 8.1
Published
5 Aug 2026
Last changed
5 Aug 2026
Added to UpHeron
3 Nov 2026
Fixed in
12.1.0
Weakness
Cross-site request forgery (CWE-352)CWE-1385
Attack
Over the network · No login needed · Needs someone to click or open something
Attacker can
Read data · Change data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Sources
Project advisories (GitHub)

Description

The WebSocket upgrade handler accepted cross-origin upgrade requests that carried the directus_session_token session cookie, without validating the Origin header of the handshake. A browser automatically attaches cookies to a WebSocket handshake and, unlike the REST and GraphQL transports, the upgrade path is registered directly on the HTTP server and therefore never passes through the CORS middleware. In affected deployments, a page on an attacker-controlled origin could open a WebSocket to a Directus instance and have the connection authenticated as the visiting user.

When a WebSocket upgrade request arrived with a session cookie present, the connection was authenticated from that cookie and the socket was established with the corresponding user's accountability. No comparison was made against the request host, PUBLIC_URL, or the CORS_ORIGIN allowlist before accepting the upgrade.

From directus/directus's security advisory. Shortened; the full text is there.

Workarounds

For deployments that cannot upgrade immediately:

  • Disable WebSockets (WEBSOCKETS_ENABLED=false) if they are not in use.
  • Avoid SESSION_COOKIE_SAME_SITE=none. Serving the Admin App and the API from the same site allows the default lax value, which prevents the cross-site case.
  • Enforce an Origin allowlist for the WebSocket paths at a reverse proxy in front of Directus.
  • Treat control of any subdomain sharing the API's registrable domain as equivalent to control of the session, and review subdomain ownership accordingly.
Workarounds as given by directus/directus's security advisory.

Affected software

SoftwareAffected versions
DirectusServers and applications · github:directus/directus
  • From 10.10.5 before 12.1.0

About Directus

The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.

From its GitHub repository.
Weekly downloads (npm)
30,924npm, 15 Nov 2026
Docker Hub pulls
50,954,770Docker Hub, 15 Nov 2026
GitHub stars
38,722GitHub, 15 Nov 2026
Forks
5,000GitHub, 15 Nov 2026
Latest release
v12.6.1GitHub, 15 Nov 2026
Released
4 Nov 2026GitHub
First published on GitHub
12 Dec 2012GitHub

References