Skip to content

Directus is Vulnerable to Stored Cross-site Scripting

Moderate severity GitHub Reviewed Published Nov 13, 2025 in directus/directus • Updated Nov 14, 2025

Package

npm directus (npm)

Affected versions

< 11.13.0

Patched versions

11.13.0

Description

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

References

@br41nslug br41nslug published to directus/directus Nov 13, 2025
Published by the National Vulnerability Database Nov 13, 2025
Published to the GitHub Advisory Database Nov 14, 2025
Reviewed Nov 14, 2025
Last updated Nov 14, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(16th percentile)

Weaknesses

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. Learn more on MITRE.

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

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. Learn more on MITRE.

CVE ID

CVE-2025-64747

GHSA ID

GHSA-vv2v-pw69-8crf

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.