CVE-2024-38527
JSON

5.4medium

Cross-site Scripting in ZenUML

Severity
5.4medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.38% (higher than 34% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-q6xv-jm4v-349h

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,

Affected

Product or packageVersionsReported by
mermaid-js zenuml-core< 3.23.25CVE List
mermaidjs zenuml-coreup to 3.0.0CVE List
@zenuml/core (npm)before 3.23.25GitHub Advisory Database

All scores

GitHub_M5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N
GitHub5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N

Classification

CWE-79CWE-80

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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,

GitHub Advisory Database
Summary

Markdown-based comments in the ZenUML diagram syntax are susceptible to Cross-site Scripting (XSS).

Details

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.

https://github.com/mermaid-js/zenuml-core/blob/dcfee8cde42673c09e19401f43ad8506658c8442/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Comment/Comment.vue#L65

PoC
// p<img onerror=alert(1) src=""/>
A->B:hi

Above is a POC diagram payload that results in an XSS.

Here is a similar POC in mermaid.live: https://mermaid.live/edit#pako:eNpNjrFuwyAQhl8F3dRK1DaQGhs1kVq1Y6duFQsylwTVgEWw1MTyuxc5S7df39399y0wRIug4IZh9qMOdU2mF-dPJAZMKaa9GTHlB_ZILmnYa9BQH3R4fTq8qbMDCh6TN86WhkUHQjTkM3rUoEq0Jv2Ui7CWPTPn-HUNA6icZqQwT9ZkfHfmlIwHdTTjpVC0Lsf0eVfazChMJoBa4BdUL6uGC8n7TrCGd5zCFRRnXbVjvBVNK3gJXbtSuMVYSlnFC-Kyf961UshWbmXf2-y_xcf29c7WP2yrVC0

Impact

This puts existing applications that use ZenUML unsandboxed at risk of arbitrary JavaScript execution when rendering user-controlled diagrams.

NVD (es)

ZenUML es una herramienta de diagramación basada en JavaScript que no requiere servidor y utiliza definiciones de texto inspiradas en Markdown y un renderizador para crear y modificar diagramas de secuencia. Los comentarios basados en Markdown en la sintaxis del diagrama ZenUML son susceptibles a Cross-site Scripting (XSS). La función de comentarios permite al usuario adjuntar pequeñas notas como referencia. Esta función permite al usuario ingresar su comentario en un comentario de markdown, lo que le permite utilizar funciones de markdown comunes, como `**` para texto en negrita. Sin embargo, el texto de markdown actualmente no se sanitiza antes de renderizarlo, lo que permite a un atacante ingresar un payload malicioso para el comentario que conduce a XSS. Esto pone a las aplicaciones existentes que usan ZenUML sin sandbox en riesgo de ejecución arbitraria de JavaScript al representar diagramas controlados por el usuario. Esta vulnerabilidad fue parcheada en la versión 3.23.25,

References

Sources

SourceRecordLicence
CVE ListCVE-2024-38527 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-q6xv-jm4v-349h changed 2026-09-10CC-BY-4.0
NVDCVE-2024-38527 changed 2026-06-17Public domain