{"id":"CVE-2023-45820","aliases":["CVE-2023-45820","GHSA-hmgw-9jrg-hf2m"],"related":[],"kind":"vulnerability","state":"published","title":"Directus crashes on invalid WebSocket message","summary":"Directus is a real-time API and App dashboard for managing SQL database content. In affected versions any Directus installation that has websockets enabled can be crashed if the websocket server receives an invalid frame. A malicious user could leverage this bug to crash Directus. This issue has been addressed in version 10.6.2. Users are advised to upgrade. Users unable to upgrade should avoid using websockets.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Directus is a real-time API and App dashboard for managing SQL database content. In affected versions any Directus installation that has websockets enabled can be crashed if the websocket server receives an invalid frame. A malicious user could leverage this bug to crash Directus. This issue has been addressed in version 10.6.2. Users are advised to upgrade. Users unable to upgrade should avoid using websockets.","source":"cvelist"},{"lang":"en","text":"### Summary\nIt seems that any Directus installation that has websockets enabled can be crashed if the websocket server receives an invalid frame. This could probably be posted as an issue and I might even be able to put together a pull request for a fix (if only I had some extra time...), but I decided to instead post as a vulnerability just for the maintainers, since this seemingly can be used to crash any live Directus server if websockets are enabled, so public disclosure is not a good idea until the issue is fixed.\n\n### Details\nThe fix for this seems quite simple; the websocket server just needs to properly catch the error instead of crashing the server. See for example: https://github.com/websockets/ws/issues/2098\n\n### PoC\n- Start a fresh Directus server (using for example the compose file here: https://docs.directus.io/self-hosted/docker-guide.html). Enable websockets by setting `WEBSOCKETS_ENABLED: 'true'` environment variable.\n- run a separate node app somewhere else to send an invalid frame to the server:\n\n```\nconst WebSocket = require(\"ws\");\nconst websocket = new WebSocket(\"ws://0.0.0.0:8055/websocket\");\nwebsocket.on(\"open\", function () {\n  const chunk = Buffer.from(\"a180\", \"hex\");\n  websocket._socket.write(chunk);\n});\n```\n\n### Impact\nThe server crashes with an error: `RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear`. Server needs to be manually restarted to get back online (if there's no recovery mechanism in place, as there often isn't with simple node servers). This was confirmed on a local server, and additionally I was able to crash our staging server with the same code, just pointing to our staging Directus server running at fly.io. It seems to also crash servers running in the [directus.cloud](https://directus.cloud) service. I created https://websocket-test.directus.app/, pointed the above script to the websocket url of that instance and the server does crash for a while. It seems that in there there's a mechanism for bringing the server back up quite fast, but it would be quite trivial for anyone to DoS any server running in directus.cloud by just spamming these invalid frames to the server.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Directus es una API y un panel de aplicaciones en tiempo real para administrar el contenido de la base de datos SQL. En las versiones afectadas, cualquier instalación de Directus que tenga websockets habilitados puede fallar si el servidor websocket recibe un frame no válido. Un usuario malintencionado podría aprovechar este error para bloquear Directus. Este problema se solucionó en la versión 10.6.2. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar deben evitar el uso de websockets.","source":"nvd"}],"published":"2023-10-19T18:38:18.856Z","modified":"2026-06-17T06:29:35.470Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-755"],"affected":[{"ranges":[{"version":">=10.4, < 10.6.2","status":"affected"}],"vendor":"directus","product":"directus","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"10.4","fixed":"10.6.2","status":"affected"}],"vendor":"directus","product":"directus","cpe":"cpe:2.3:a:directus:directus:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"10.4.0","status":"affected","fixed":"10.6.2"}],"ecosystem":"npm","package":"directus","purl":"pkg:npm/directus","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"10.4.0","fixed":"10.6.2"}],"vendor":"monospace","product":"directus","cpe":"cpe:2.3:a:monospace:directus:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/directus/directus/security/advisories/GHSA-hmgw-9jrg-hf2m","tags":["exploit","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/directus/directus/commit/243eed781b42d6b4948ddb8c3792bcf5b44f55bb","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45820","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/directus/directus","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/directus/directus/releases/tag/v10.6.2","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-09-12T17:37:55.720Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-45820","url":"https://www.cve.org/CVERecord?id=CVE-2023-45820","licence":"CVE Terms of Use","modified":"2024-09-12T17:51:27.185Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hmgw-9jrg-hf2m","url":"https://github.com/advisories/GHSA-hmgw-9jrg-hf2m","licence":"CC-BY-4.0","modified":"2023-11-08T04:13:39.905Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-45820","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45820","licence":"Public domain","modified":"2026-06-17T06:29:35.470Z"}],"updatedAt":"2026-11-25T22:58:28.941Z","epss":{"score":0.00834,"percentile":0.58792,"date":"2026-12-01T12:00:22.000Z"}}