Impact
Mermaid accepts configuration values that influence the appearance of its diagrams. In versions prior to 10.9.6 and 11.15.0, the default configuration permits the injection of CSS through the fontFamily, themeCSS, and altFontFamily options. This unsanitized CSS is processed by stylis, which can expose the styling instructions beyond the diagram’s scope, enabling style injection that can modify arbitrary page elements, define global @font-face or @keyframes rules, and exploit CSS :has() selectors for data exfiltration. The result is the ability to deface the page or extract attribute values, compromising the visual integrity and potentially the confidentiality of page content.
Affected Systems
The vulnerability affects the Mermaid JavaScript diagramming library. Versions earlier than 10.9.6 (any 10.x release) and earlier than 11.15.0 (any 11.x release) are impacted. Upgrading to 10.9.6 or later 11.15.0 eliminates the flaw.
Risk and Exploitability
The CVSS score of 5.3 places the issue in the medium severity range. EPSS is unavailable, and the vulnerability is not listed in CISA KEV, indicating no known widespread exploitation. The likely attack vector is via an untrusted Mermaid configuration supplied to the rendering engine, such as through user‑generated Mermaid source embedded on a web page. An attacker would need to supply malicious configuration to trigger the injection, after which the injected CSS can deface the page or exfiltrate attribute data. While the vulnerability does not provide arbitrary code execution, the impact on trust and visual integrity is significant for applications that rely on Mermaid.
OpenCVE Enrichment
Github GHSA