GHSA-VV2V-PW69-8CRF
Vulnerability from github – Published: 2025-11-14 21:45 – Updated: 2025-11-14 21:45Summary
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:
-
JavaScript File Upload: Attackers upload a malicious JavaScript file via the files endpoint, obtaining a file ID accessible through the assets directory
-
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
-
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
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "directus"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "11.13.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-64747"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2025-11-14T21:45:36Z",
"nvd_published_at": "2025-11-13T22:15:52Z",
"severity": "MODERATE"
},
"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\u0027s 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",
"id": "GHSA-vv2v-pw69-8crf",
"modified": "2025-11-14T21:45:36Z",
"published": "2025-11-14T21:45:36Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Directus is Vulnerable to Stored Cross-site Scripting"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.