CVE-2026-26226beautiful-mermaid < 0.1.3 SVG Attribute Injection
beautiful-mermaid versions prior to 0.1.3 contain an SVG attribute injection issue that can lead to cross-site scripting (XSS) when rendering attacker-controlled Mermaid diagrams. User-controlled values from Mermaid style and classDef directives are interpolated into SVG attribute values without proper escaping, allowing crafted input to break out of an attribute context and inject arbitrary SVG elements/attributes into the rendered output. When the generated SVG is embedded in a web page, this can result in script execution in the context of the embedding origin.
What to do
Fixed builds are available from npm: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| npm library | beautiful-mermaid | Fixed | 0.1.3 | GHSA-cgmm-x5ww-q5cr |
What the vendor says
As published in the CVE record by VulnCheck, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- lukilabs beautiful-mermaid: affected: before 0.1.3; fixed in
0.1.3
Vendor advisories:
- https://github.com/lukilabs/beautiful-mermaid/releases/tag/v0.1.3 (patch, release-notes)
- https://github.com/lukilabs/beautiful-mermaid/pull/8 (patch)
References
- https://github.com/lukilabs/beautiful-mermaid/releases/tag/v0.1.3
- https://github.com/lukilabs/beautiful-mermaid/pull/8
- https://neo.projectdiscovery.io/share/cec71dc7-a8eb-417e-b8b4-666644796c1e
- https://www.vulncheck.com/advisories/beautiful-mermaid-svg-attribute-injection
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.