Skip to main content

CVE-2022-24814: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in directus directus

Medium
Published: Mon Apr 04 2022 (04/04/2022, 17:50:11 UTC)
Source: CVE
Vendor/Project: directus
Product: directus

Description

Directus is a real-time API and App dashboard for managing SQL database content. Prior to version 9.7.0, unauthorized JavaScript (JS) can be executed by inserting an iframe into the rich text html interface that links to a file uploaded HTML file that loads another uploaded JS file in its script tag. This satisfies the regular content security policy header, which in turn allows the file to run any arbitrary JS. This issue was resolved in version 9.7.0. As a workaround, disable the live embed in the what-you-see-is-what-you-get by adding `{ "media_live_embeds": false }` to the _Options Overrides_ option of the Rich Text HTML interface.

AI-Powered Analysis

AILast updated: 06/23/2025, 11:21:11 UTC

Technical Analysis

CVE-2022-24814 is a cross-site scripting (XSS) vulnerability identified in Directus, an open-source real-time API and application dashboard used for managing SQL database content. The vulnerability affects Directus versions prior to 9.7.0. It arises from improper neutralization of input during web page generation, specifically within the rich text HTML interface that supports live embedding of media content. An attacker can exploit this flaw by inserting an iframe into the rich text editor that references an uploaded HTML file. This HTML file, in turn, loads a JavaScript file via a script tag. Due to the way Directus implements its content security policy (CSP), this embedded script is allowed to execute arbitrary JavaScript code despite the CSP headers, effectively bypassing intended security controls. This enables unauthorized JavaScript execution within the context of the Directus application, potentially allowing an attacker to perform actions such as session hijacking, data theft, or manipulation of the user interface. The vulnerability was addressed in Directus version 9.7.0 by modifying how live embeds are handled to prevent such unauthorized script execution. As an interim mitigation, administrators can disable the live embed feature in the rich text HTML interface by setting the "media_live_embeds" option to false in the _Options Overrides_ configuration. There are no known exploits in the wild reported for this vulnerability, but the nature of XSS vulnerabilities makes them a significant risk if left unpatched, especially in environments where untrusted users can upload or edit content.

Potential Impact

For European organizations using Directus versions earlier than 9.7.0, this vulnerability poses a moderate risk to the confidentiality and integrity of their data and user sessions. Successful exploitation could allow attackers to execute arbitrary JavaScript in the context of the Directus dashboard, potentially leading to unauthorized access to sensitive database content, manipulation of displayed data, or theft of authentication tokens. This could disrupt business operations, compromise data integrity, and lead to reputational damage. Given that Directus is often used to manage critical SQL database content in real-time, the impact on availability is less direct but could occur if attackers leverage the XSS to perform further attacks such as privilege escalation or injecting malicious payloads. The vulnerability is particularly concerning in multi-tenant or collaborative environments where multiple users have access to the Directus interface, as it could facilitate lateral movement or broader compromise. European organizations in sectors with strict data protection regulations, such as finance, healthcare, and government, may face additional compliance risks if this vulnerability is exploited to leak personal or sensitive data.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should prioritize upgrading Directus installations to version 9.7.0 or later, where the issue is fully resolved. If immediate upgrading is not feasible, administrators should disable the live embed feature in the rich text HTML interface by adding the configuration { "media_live_embeds": false } to the _Options Overrides_ setting. This prevents the embedding of potentially malicious iframes and scripts. Additionally, organizations should audit user permissions to restrict who can upload or edit rich text content, limiting this capability to trusted users only. Implementing strict content validation and sanitization on uploaded files can further reduce risk. Monitoring application logs for unusual iframe or script upload activity can help detect attempted exploitation. Finally, organizations should review and tighten their Content Security Policy headers beyond the default, ensuring that only trusted sources are allowed to execute scripts and embed content. Regular security training for users managing Directus content can also help prevent inadvertent introduction of malicious code.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-02-10T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9843c4522896dcbf2bf2

Added to database: 5/21/2025, 9:09:23 AM

Last enriched: 6/23/2025, 11:21:11 AM

Last updated: 8/12/2025, 3:36:01 AM

Views: 17

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats