CVE-2026-41159

Mermaid: Improper sanitization of configuration leads to CSS injection

MEDIUM
5.3
CVSS Score
Published: May 29, 2026 at 01:53 PM UTC
Updated: July 21, 2026 at 01:39 PM UTC
2 products affected across 2 vendorsMermaidMermaid

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.5%
SSVC
No known exploit

Description

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.6 and 11.15.0, Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options. The injected CSS exploits stylis's & (scope reference) handling. :not(&) escapes the #mermaid-xxx automatic scoping, applying styles to all page elements. Global at-rules (@font-face, @keyframes, @counter-style) are also injectable as stylis hoists them to top level. This allows page defacement and DOM attribute exfiltration via CSS :has() selectors. This vulnerability is fixed in 10.9.6 and 11.15.0.

Affected

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

v < 10.9.611.0.0 ≤ v < 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
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

SSVCNo known exploitNot automatablePartial impact

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

CVSS

5.3MEDIUMGitHub_M
Vector?

Quick Info

StatusMODIFIED
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