Vulnerability · Published Aug 19, 2025 · Assigned by GitHub_M

CVE-2025-54881Mermaid improperly sanitizes of sequence diagram labels leading to XSS

Medium 5.3

In plain English

A medium-severity cross-site scripting in mermaid from mermaid-js. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 57% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)5.3Medium
Exploit odds (30 days)0.8%top 43.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. In the default configuration of mermaid 10.9.0-rc.1 to 11.9.0, user supplied input for sequence diagram labels is passed to innerHTML during calculation of element size, causing XSS.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Ubuntu:22.04:LTSnode-mermaidno fix listedUBUNTU-CVE-2025-54881
Ubuntu:26.10node-mermaidno fix listedUBUNTU-CVE-2025-54881
npmmermaid11.10.0GHSA-7rqq-prvp-x9jh
npmmermaid10.9.4GHSA-7rqq-prvp-x9jh

Affected products (as reported)

VendorProductVersions
mermaid-js mermaid >= 10.9.0-rc.1, <= 11.9.0

Weakness: CWE-79 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

References