Code Injection in mermaid - CVE-2026-41148
Published: May 12, 2026
mermaid
mermaid-js
Description
The vulnerability allows a remote attacker to inject arbitrary CSS into the page.
The vulnerability exists due to improper neutralization of special elements in createCssStyles when processing user-controlled classDef style strings in diagrams. A remote attacker can supply a specially crafted diagram definition to inject arbitrary CSS into the page.
User interaction is required to render a crafted diagram.