CVE-2026-41159

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

Configuration 1 (hide)

OR cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*
cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*

History

01 Jun 2026, 18:38

Type Values Removed Values Added
First Time Mermaid Project
Mermaid Project mermaid
References () https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aahttps://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76 - () https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aahttps://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76 - Patch
References () https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.15.0 - () https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.15.0 - Release Notes
References () https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6 - () https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6 - Release Notes
References () https://github.com/mermaid-js/mermaid/security/advisories/GHSA-87f9-hvmw-gh4p - () https://github.com/mermaid-js/mermaid/security/advisories/GHSA-87f9-hvmw-gh4p - Third Party Advisory
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.3
CPE cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*

29 May 2026, 15:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-05-29 15:16

Updated : 2026-06-01 18:38


NVD link : CVE-2026-41159

Mitre link : CVE-2026-41159

CVE.ORG link : CVE-2026-41159


JSON object : View

Products Affected

mermaid_project

  • mermaid
CWE
CWE-94

Improper Control of Generation of Code ('Code Injection')