Code Injection in mermaid - CVE-2026-41148

 

Code Injection in mermaid - CVE-2026-41148

Published: May 12, 2026


Vulnerability identifier: #VU131137
CSH Severity: Medium
CVSSv4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:U/U:Green
CVE-ID: CVE-2026-41148
CWE-ID: CWE-94
Exploitation vector: Remote access
Exploit availability: No public exploit available
Vulnerable software:
mermaid
Software vendor:
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.


Remediation

Install security update from vendor's website.

External links