CVE-2022-24814 Cross-site Scripting in Directus
Attackers can execute arbitrary JavaScript via crafted iframes in rich text fields, potentially leading to session hijacking or data theft.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-24814?
CVE-2022-24814 is a high-severity cross-site scripting vulnerability in directus, published on 4 Apr 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-79
Which versions are affected by CVE-2022-24814?
2 open source packages ship an affected version, including directus. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
directus npm | All versions | 9.7.0 |
directus npm | All versions | 9.7.0 |
Products include Rangerstudio Directus.
How do I fix CVE-2022-24814?
Upgrade directus to 9.7.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2022-24814 being exploited?
There is no known exploitation of CVE-2022-24814 in the wild and no public exploit code.
Other vulnerabilities in directus
Sources
Also known as GHSA-xmjj-3c76-5w84.