# CVE-2026-41149: Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection

- Severity: Medium 5.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.40%, higher than 36% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-05-11T19:36:46.000Z
- Modified: 2026-09-10T03:51:05.683Z
- Also known as: GHSA-ghcm-xqfw-q4vr
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and earlier, as well as 11.0.0-alpha.1 through 11.14.0, are vulnerable to HTML injection under the default configuration. Specifically, the classDef directive in Mermaid state diagrams permits DOM injection that escapes the SVG context. However, <script> tags are stripped, which prevents cross-site scripting (XSS). This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting "securityLevel": "sandbox", which prevents the issue by rendering the mermaid diagram in a sandboxed <iframe>.

(As written by CVE List.)

## Affected

- mermaid-js mermaid: >= 11.0.0-alpha.1, < 11.15.0; < 10.9.6
- mermaid (npm): from 11.0.0-alpha.1 before 11.15.0; before 10.9.6

## Every score

- GitHub_M: CVSS:4.0 5.3 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L`

## References

- <https://github.com/mermaid-js/mermaid/security/advisories/GHSA-ghcm-xqfw-q4vr> (exploit, web)
- <https://github.com/mermaid-js/mermaid/commit/37ff937f1da2e19f882fd1db01235db4d01f4056> (web)
- <https://github.com/mermaid-js/mermaid/commit/4e2d512bf5bf6f9de1a8f0a48da78dc4d09ac4f3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-41149> (advisory)
- <https://github.com/mermaid-js/mermaid> (package)
- <https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.15.0> (web)
- <https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6> (web)
- <https://mermaid.js.org/config/schema-docs/config.html#securitylevel> (web)

## Sources

- CVE List: [CVE-2026-41149](https://www.cve.org/CVERecord?id=CVE-2026-41149), CVE Terms of Use, modified 2026-05-23
- GitHub Advisory Database: [GHSA-ghcm-xqfw-q4vr](https://github.com/advisories/GHSA-ghcm-xqfw-q4vr), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-41149](https://nvd.nist.gov/vuln/detail/CVE-2026-41149), Public domain, modified 2026-07-23

---

Page: https://cve.day/CVE-2026-41149 · Whole record: https://cve.day/CVE-2026-41149.json · Rebuilt by cve.day 2026-11-25T22:59:22.214Z
