Back to CVE records
Medium 5.3Published May 29, 2026

CVE-2026-41159Mermaid: Improper sanitization of configuration leads to CSS injection

Updated under an hour ago ()

Does this affect you?

It affects mermaid-js mermaid and 1 other product. Add what you run to find out whether that includes you.

No exploitation reported and no EPSS estimate yet.

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
5.3 MEDIUM (v4.0, CNA)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
Weakness (CWE)
CWE-94
Known exploited
Not in CISA's KEV catalog
EPSS (exploitation in the next 30 days)
Not loaded for this CVE
Assigned by
GitHub_M
NVD analysis
Modified
Record last updated
Jul 1, 2026
First seen by InfoSec Signals
Oct 9, 2026

Affected products

Affected products
mermaid-js mermaid
mermaid_js:mermaid (from the name)
from 11.0.0-alpha.1, < 11.15.0; before 10.9.6
CNA record
mermaid_project mermaid
mermaid_project:mermaid
before 10.9.6; from 11.0.0 before 11.15.0
NVD

References

References

The CVE record is authoritative. Products marked “from the name” were identified from the CNA's free-text names, not a CPE, and are matched less certainly. This product uses the NVD API but is not endorsed or certified by the NVD.

Your cookie choices
We use essential cookies to run this site, and, only with your consent, an advertising cookie from Google to measure whether our ads lead to sign-ups and subscriptions. See our for details.