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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu:22.04:LTS | node-mermaid | no fix listed | UBUNTU-CVE-2025-54881 |
| Ubuntu:26.10 | node-mermaid | no fix listed | UBUNTU-CVE-2025-54881 |
| npm | mermaid | 11.10.0 | GHSA-7rqq-prvp-x9jh |
| npm | mermaid | 10.9.4 | GHSA-7rqq-prvp-x9jh |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh x_refsource_CONFIRM
- https://github.com/mermaid-js/mermaid/commit/5c69e5fdb004a6d0a2abe97e23d26e223a059832 x_refsource_MISC
- https://github.com/mermaid-js/mermaid/commit/685516a85ec1df64cefd4fd15f26533be87d458e x_refsource_MISC