CSS Injection Vulnerability in Mermaid JavaScript Tool from Mermaid
CVE-2026-41159

5.3MEDIUM

Key Information:

Vendor

Mermaid-js

Status
Vendor
CVE Published:
29 May 2026

What is CVE-2026-41159?

Mermaid is a JavaScript tool that utilizes Markdown-inspired syntax for diagram creation. Prior to versions 10.9.6 and 11.15.0, Mermaid's default settings allowed for CSS injection through its configuration options. This security issue arises from how stylis handles scope references, permitting the application of injected CSS styles beyond the designated Mermaid diagram area. Consequently, vulnerabilities emerged enabling global style injections, such as @font-face and @keyframes, allowing attackers to alter page aesthetics and extract DOM attributes via CSS selectors. The issue has been rectified in the specified versions, enhancing the security posture of the Mermaid tool.

Affected Version(s)

mermaid >= 11.0.0-alpha.1, < 11.15.0 < 11.0.0-alpha.1, 11.15.0

mermaid < 10.9.6 < 10.9.6

References

CVSS V4

Score:
5.3
Severity:
MEDIUM
Confidentiality:
None
Integrity:
Low
Availability:
None
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
Unknown

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.