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

21 Jul 2026, 12:10

Type Values Removed Values Added
Summary
  • (es) Mermaid es una herramienta de JavaScript que utiliza texto inspirado en Markdown para crear y modificar diagramas y gráficos. Antes de las versiones 10.9.6 y 11.15.0, la configuración predeterminada de Mermaid permite inyectar CSS que se aplica fuera del diagrama de Mermaid a través de las opciones de configuración fontFamily, themeCSS y altFontFamily. El CSS inyectado explota el manejo de & (referencia de ámbito) de stylis. :not(&) escapa el alcance automático #mermaid-xxx, aplicando estilos a todos los elementos de la página. Las reglas globales at-rules (@font-face, @keyframes, @counter-style) también son inyectables, ya que stylis las eleva al nivel superior. Esto permite la desfiguración de la página y la exfiltración de atributos del DOM a través de selectores CSS :has(). Esta vulnerabilidad se corrige en las versiones 10.9.6 y 11.15.0.

01 Jul 2026, 20:17

Type Values Removed Values Added
References
  • {'url': 'https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aahttps://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76', 'tags': ['Patch'], 'source': 'security-advisories@github.com'}
  • () https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aa -
  • () https://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76 -

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-07-21 12:10


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')