CVE-2026-41149 Details
Description
Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and earlier, as well as 11.0.0-alpha.1 through 11.14.0, are vulnerable to HTML injection under the default configuration. Specifically, the classDef directive in Mermaid state diagrams permits DOM injection that escapes the SVG context. However, <script> tags are stripped, which prevents cross-site scripting (XSS). This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting "securityLevel": "sandbox", which prevents the issue by rendering the mermaid diagram in a sandboxed <iframe>.
A vulnerability allowing HTML injection has been identified in Mermaid versions 10.9.5 and earlier, as well as 11.0.0-alpha.1 through 11.14.0. The issue arises in state diagrams where the classDef directive permits DOM injection that escapes the SVG context. Although <script> tags are removed to prevent cross-site scripting, this flaw can still be exploited. The vulnerability has been addressed in Mermaid versions 10.9.6 and 11.15.0. For those unable to upgrade, a temporary workaround is available by setting 'securityLevel' to 'sandbox', which renders the diagram in a protected <iframe>.
Users can upgrade to Mermaid versions 10.9.6 or 11.15.0 to address this vulnerability. If an immediate upgrade is not possible, the 'securityLevel' can be set to 'sandbox' to prevent the issue by rendering the Mermaid diagram in a sandboxed <iframe>.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed May 22, 2026CISA-ADP
Assessed May 23, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/mermaid-js/mermaid/security/advisories/GHSA-ghcm-xqfw-q4vr | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://github.com/mermaid-js/mermaid/commit/37ff937f1da2e19f882fd1db01235db4d01f4056 | [email protected] | Source CodeVendor |
| https://github.com/mermaid-js/mermaid/commit/4e2d512bf5bf6f9de1a8f0a48da78dc4d09ac4f3 | [email protected] | Source CodeVendor |
| https://github.com/mermaid-js/mermaid/security/advisories/GHSA-ghcm-xqfw-q4vr | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Mermaid | >= 11.0.0-alpha.1, <= 11.14.0 (semver) <= 10.9.5 (semver) |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 23, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 23, 2026 | CVE Modified | CISA-ADP |
| May 22, 2026 | New CVE Received | [email protected] |
Volerion