CVE-2026-41159

MEDIUM CVSS 4.0: 5.3 EPSS 0.49%
Updated Jul 21, 2026
Mermaid_Project
Parameter Value
CVSS 5.3 (MEDIUM)
Affected Versions 11.0.0 — 11.15.0
Fixed In 10.9.6
Type CWE-94 (Code Injection)
Vendor Mermaid_Project
Public PoC No

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.

Attack Parameters

Attack Vector
Network
Can be exploited remotely
Attack Complexity
Low
Easy to exploit
Attack Requirements
None
No additional conditions
Privileges Required
None
No privileges needed
User Interaction
Passive
Minimal interaction

Impact Assessment

Confidentiality
None
No data leak
Integrity
Low
Partial data modification
Availability
None
No disruption

CVSS Vector v4.0

Weakness Type (CWE)

Vulnerable Products 2

Configuration From (including) Up to (excluding)
Mermaid_Project Mermaid
cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*
— 10.9.6
Mermaid_Project Mermaid
cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*
11.0.0 11.15.0

Related Vulnerabilities