RCE in Mermaid-Js Mermaid
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.
Vulnerability class: RCE (Remote Code Execution)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 5.3 (Medium). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
EPSS exploit prediction
EPSS: 0.005 (41.9th percentile), scored .
Very low probability of exploitation in the next 30 days; routine patching cadence is appropriate. 42nd percentile — 41.9% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.
EPSS over last 30 days · oldest: 0.005 · newest: 0.005 · change: -0.001
Affected products
- Mermaid-Js Mermaid — versions >= 11.0.0-alpha.1, < 11.15.0, < 10.9.6
- Mermaid Project
Weakness classification (CWE)
References
- github.com/mermaid-js/mermaid/security/advisories/GHSA-87f9-hvmw-gh4p (Third Party Advisory)
- github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aaht… (Patch)
- github.com/mermaid-js/mermaid/releases/tag/mermaid@11.15.0 (Release Notes)
- github.com/mermaid-js/mermaid/releases/tag/v10.9.6 (Release Notes)
- github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aa
- github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76
Frequently asked questions
- What is CVE-2026-41159?
- CVE-2026-41159 is a medium-severity vulnerability in Mermaid-Js Mermaid, classified under Code Injection. CVSS score: 5.3/10. Published 2026-05-29.
- How severe is CVE-2026-41159?
- Medium severity. CVSS v3 base score is 5.3 out of 10.