CVE-2026-41149

Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection

MEDIUM
5.3
CVSS Score
Published: May 22, 2026 at 10:34 PM UTC
Updated: July 23, 2026 at 07:32 PM UTC
1 product affected across 1 vendorMermaid

Using mermaid by mermaid-js?

Get instant alerts when new vulnerabilities affect mermaid - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.3
Exploit prediction
EPSS 0.4%
SSVC
PoC

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

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 10.9.6v < 11.15.0
Affected range stops below 10.9.6, so it looks safe — our inference, not a vendor statement
Affected range stops below 11.15.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.3MEDIUMGitHub_M
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-94

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card