CVE-2024-38527 Cross-site Scripting in ZenUML
Attackers can execute arbitrary JavaScript via unsanitized markdown comments in ZenUML diagrams, affecting applications rendering user-controlled content.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-38527?
CVE-2024-38527 is a medium-severity cross-site scripting vulnerability in mermaid-js zenuml-core, published on 26 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
ZenUML is JavaScript-based diagramming tool that requires no server, using Markdown-inspired text definitions and a renderer to create and modify sequence diagrams. Markdown-based comments in the ZenUML diagram syntax are susceptible to Cross-site Scripting (XSS). The comment feature allows the user to attach small notes for reference. This feature allows the user to enter in their comment in markdown comment, allowing them to use common markdown features, such as `**` for bolded text. However, the markdown text is currently not sanitized before rendering, allowing an attacker to enter a malicious payload for the comment which leads to XSS. This puts existing applications that use ZenUML unsandboxed at risk of arbitrary JavaScript execution when rendering user-controlled diagrams. This vulnerability was patched in version 3.23.25,
Weakness: CWE-79
Which versions are affected by CVE-2024-38527?
2 open source packages ship an affected version, including @zenuml/core.
| Package | Affected | Fixed in |
|---|---|---|
@zenuml/core npm | All versions | 3.23.25 |
@zenuml/core npm | All versions | 3.23.25 |
How do I fix CVE-2024-38527?
Upgrade @zenuml/core to 3.23.25 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-2024-38527 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-38527 exists.
Sources
Also known as GHSA-q6xv-jm4v-349h.