Impact
Malicious input in the classDef directive can inject arbitrary HTML elements into a diagram. It is classified as a CWE-94 code injection vulnerability. The vulnerability escapes the SVG context but strips <script> tags, so it does not directly allow XSS, yet it still permits DOM injection that may be abused to manipulate the page, exfiltrate information, or create phishing interfaces within the diagram container.
Affected Systems
Mermaid-js Mermaid packages prior to version 10.9.6 and prior to 11.15.0, specifically 10.9.5 and older, as well as 11.0.0-alpha.1 through 11.14.0, are affected under the default configuration.
Risk and Exploitability
With a CVSS score of 5.3 and no EPSS information, the risk is moderate. The vulnerability is not listed in the CISA KEV catalog. Attackers could exploit it by delivering a crafted diagram via a web page or API that renders Mermaid. While the injection does not enable script execution directly, the injected HTML can manipulate the DOM or embed hidden iframes, potentially facilitating data exfiltration or click‑jacking. The likely attack vector, inferred from the description, is remote, relying on the victim’s browser rendering the diagram under the default configuration.
OpenCVE Enrichment
Github GHSA