CVE-2025-64747: Directus Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-vv2v-pw69-8crf
CVSS 5.5
CWE-20 CWE-79
Published
Advisory Summary

CVE-2025-64747 is a MODERATE (CVSS 5.5) cross-site scripting vulnerability (CWE-20: Improper Input Validation) affecting Directus libraries in the npm ecosystem. The issue involves directus is vulnerable to stored cross-site scripting. Remediation is available by upgrading affected packages to version 11.13.0.

CVE-2025-64747 at a Glance

CVE Identifier CVE-2025-64747
GHSA Identifier GHSA-vv2v-pw69-8crf
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Directus
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-64747

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.

directus fixed: 11.13.0
npm install directus@11.13.0
Verify Direct and Transitive Dependencies

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-2025-64747, 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.13.0), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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

### Summary A stored cross-site scripting (XSS) vulnerability exists that allows users with `upload files` and `edit item` permissions to inject malicious JavaScript through the Block Editor interface. Attackers can bypass Content Security Policy (CSP) restrictions by combining file uploads with iframe srcdoc attributes, resulting in persistent XSS execution. ### Details The vulnerability arises from insufficient sanitization in the Block Editor interface when processing JSON content containing HTML elements. The attack requires two permissions: - `upload files` - To upload malicious JavaScript files - `edit item` - To create or modify content with the Block Editor **Attack Vector:** 1. **JavaScript File Upload**: Attackers upload a malicious JavaScript file via the files endpoint, obtaining a file ID accessible through the assets directory 2. **Block Editor Exploitation**: Using a JSON field with Block Editor interface, attackers inject raw HTML containing an iframe with srcdoc attribute that references the uploaded file 3. **CSP Bypass**: The iframe srcdoc technique circumvents existing CSP protections by creating a new document context that loads the uploaded script The payload is injected through direct API manipulation (PATCH request) to bypass client-side validation, targeting the Block Editor's paragraph data structure within the JSON content field. ### Impact This vulnerability enables: - **Persistent XSS** - Malicious scripts execute whenever affected content is viewed - **Session hijacking** - Access to authentication tokens and cookies of users viewing the content - **Administrative compromise** - If administrators view infected content, their elevated privileges can be exploited - **CSP bypass** - Demonstrates ineffective security controls, potentially affecting other protections - **Data exfiltration** - Ability to steal sensitive information displayed in the application - **Phishing attacks** - Injection of convincing fake login forms or malicious redirects

CVE-2025-64747 Affected Directus Versions

1 component(s)
Fixed Versions:
11.13.0
Product / Package Ecosystem Affected Versions Fixed Version
directus
npm
< 11.13.0
11.13.0

References

Frequently Asked Questions

What is CVE-2025-64747?
CVE-2025-64747 is a security vulnerability in Directus involving Directus is Vulnerable to Stored Cross-site Scripting under CWE-20: Improper Input Validation.
Which Directus versions are affected?
Affected versions include releases prior to 11.13.0 across affected packages: directus.
What version fixes CVE-2025-64747?
Upgrading to 11.13.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is directus affected?
Yes, directus is affected in releases prior to 11.13.0. Upgrade your dependency to 11.13.0 or later.
What is the CVSS score of CVE-2025-64747?
CVE-2025-64747 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2025-64747?
CVE-2025-64747 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2025-64747?
Run the dependency tree command: 'npm ls directus'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vv2v-pw69-8crf",
  "modified" : "2025-11-14T21:45:36Z",
  "published" : "2025-11-14T21:45:36Z",
  "aliases" : [ "CVE-2025-64747" ],
  "summary" : "Directus is Vulnerable to Stored Cross-site Scripting",
  "details" : "### Summary\n\nA stored cross-site scripting (XSS) vulnerability exists that allows users with `upload files` and `edit item` permissions to inject malicious JavaScript through the Block Editor interface. Attackers can bypass Content Security Policy (CSP) restrictions by combining file uploads with iframe srcdoc attributes, resulting in persistent XSS execution.\n\n### Details\n\nThe vulnerability arises from insufficient sanitization in the Block Editor interface when processing JSON content containing HTML elements. The attack requires two permissions:\n- `upload files` - To upload malicious JavaScript files\n- `edit item` - To create or modify content with the Block Editor\n\n**Attack Vector:**\n\n1. **JavaScript File Upload**: Attackers upload a malicious JavaScript file via the files endpoint, obtaining a file ID accessible through the assets directory\n\n2. **Block Editor Exploitation**: Using a JSON field with Block Editor interface, attackers inject raw HTML containing an iframe with srcdoc attribute that references the uploaded file\n\n3. **CSP Bypass**: The iframe srcdoc technique circumvents existing CSP protections by creating a new document context that loads the uploaded script\n\nThe payload is injected through direct API manipulation (PATCH request) to bypass client-side validation, targeting the Block Editor's paragraph data structure within the JSON content field.\n\n### Impact\n\nThis vulnerability enables:\n- **Persistent XSS** - Malicious scripts execute whenever affected content is viewed\n- **Session hijacking** - Access to authentication tokens and cookies of users viewing the content\n- **Administrative compromise** - If administrators view infected content, their elevated privileges can be exploited\n- **CSP bypass** - Demonstrates ineffective security controls, potentially affecting other protections\n- **Data exfiltration** - Ability to steal sensitive information displayed in the application\n- **Phishing attacks** - Injection of convincing fake login forms or malicious redirects",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "directus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.13.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/security/advisories/GHSA-vv2v-pw69-8crf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64747"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/commit/d23525317f0780f04aa1fe7a99171a358e43cb2e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/directus/directus"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-14T21:45:36Z",
    "nvd_published_at" : "2025-11-13T22:15:52Z"
  }
}