{"cve":"CVE-2026-41159","nvd":{"published":"2026-05-29T15:16:22.813","modified":"2026-07-21T12:10:00.090","status":"Modified","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.","cvss_v4":{"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L","score":5.3},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3},"cwes":["CWE-94"],"references":["https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aa","https://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76","https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.15.0","https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6","https://github.com/mermaid-js/mermaid/security/advisories/GHSA-87f9-hvmw-gh4p"],"products":["mermaid_project:mermaid"],"source":"nvd","synced_at":"2026-10-19T22:37:48.043517290+00:00"},"epss":{"cve":"CVE-2026-41159","score":0.00486,"percentile":0.41909,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-87f9-hvmw-gh4p","url":"https://osv.dev/vulnerability/GHSA-87f9-hvmw-gh4p","summary":"Mermaid: Improper sanitization of configuration leads to CSS injection","modified":"2026-09-10T03:51:04.895749263Z","packages":[{"ecosystem":"npm","name":"mermaid","purl":"pkg:npm/mermaid","ranges":[">=11.0.0-alpha.1 <11.15.0"],"fixed":["11.15.0"]},{"ecosystem":"npm","name":"mermaid","purl":"pkg:npm/mermaid","ranges":["<10.9.6"],"fixed":["10.9.6"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}