Code Injection in mermaid - CVE-2026-41149
Published: May 12, 2026
mermaid
mermaid-js
Description
The vulnerability allows a remote attacker to inject HTML into the DOM.
The vulnerability exists due to improper sanitization in the state diagram classDef handling when rendering user-supplied state diagrams. A remote attacker can supply a specially crafted diagram definition to inject HTML into the DOM.
Under the default configuration, the injected content can escape the SVG context, and user interaction is required.