CVE-2026-41149 Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
- Technology
- UbuntuDebianRed Hat
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>.
Upgrade path
7 packages: 1 fixed, 5 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/node-mermaid(Debian 14) | = 8.7.0+ds+~cs27.17.17-1; = 8.7.0+ds+~cs27.17.17-2; = 8.7.0+ds+~cs27.17.17-2~bpo10+1; = 8.7.0+ds+~cs27.17.17-3 +13 more | No fix listed | No fix yet |
| redhat/rh-podman-desktop.git(Red Hat podman_desktop 1) | All versions | No fix listed | No fix yet |
| redhat/rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9(Red Hat openshift_ai) | All versions | No fix listed | No fix yet |
| ubuntu/node-mermaid(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/node-mermaid(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| npm mermaid(npm) | < 10.9.6; <= 10.9.5; >= 11.0.0-alpha.1, < 11.15.0; >= 11.0.0-alpha.1, <= 11.14.0 | 10.9.6, 11.15.0 | Fixed |
| mermaid-js mermaid | = < 10.9.6; = >= 11.0.0-alpha.1, < 11.15.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| mermaid-js mermaid | = >= 11.0.0-alpha.1, < 11.15.0 | No fix listed |
| mermaid-js mermaid | = < 10.9.6 | No fix listed |
| debian/node-mermaid(Debian:14) | All versions | No fix listed |
| npm mermaid(npm) | >= 11.0.0-alpha.1, <= 11.14.0 | No fix listed |
| npm mermaid(npm) | <= 10.9.5 | No fix listed |
| redhat/rh-podman-desktop.git(Red Hat:podman_desktop:1) | All versions | No fix listed |
| redhat/rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9(Red Hat:openshift_ai) | All versions | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.11.0+ds+~cs29.13.22-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.13.2+ds+~cs30.13.21-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.13.2+ds+~cs30.13.21-1.1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.13.3+ds+~cs26.13.21-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.13.3+ds+~cs26.13.21-2 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.13.8+~cs10.4.16-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.14.0+ds1+~cs11.4.14-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.14.0+~cs11.4.14-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.7.0+ds+~cs27.17.17-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.7.0+ds+~cs27.17.17-2 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.7.0+ds+~cs27.17.17-2~bpo10+1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.7.0+ds+~cs27.17.17-3 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.9.1+ds+~cs26.20.25-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 8.9.3+ds+~cs29.13.19-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 9.2.2+~2.0.0-1 | No fix listed |
| debian/node-mermaid(Debian:14) | = 9.2.2+~2.0.0-2 | No fix listed |
| ubuntu/node-mermaid(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/node-mermaid(Ubuntu:26.10) | All versions | No fix listed |
Show 2 more
| Product | Affected versions | Fixed in |
|---|---|---|
| npm mermaid(npm) | >= 11.0.0-alpha.1, < 11.15.0 | 11.15.0 |
| npm mermaid(npm) | < 10.9.6 | 10.9.6 |
References
- https://github.com/mermaid-js/mermaid/security/advisories/GHSA-ghcm-xqfw-q4vr exploit vendor-advisory
- https://github.com/mermaid-js/mermaid/commit/37ff937f1da2e19f882fd1db01235db4d01f4056 patch
- https://github.com/mermaid-js/mermaid/commit/4e2d512bf5bf6f9de1a8f0a48da78dc4d09ac4f3 patch
- Debian Security Tracker CVE-2026-41149 vendor-advisory
- bugs.debian.org issue-tracking
- github.com
- github.com
- mermaid.js.org
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com
- Red Hat CVE page mitigation vendor-advisory
- Red Hat Bugzilla 2480864 issue-tracking
- www.cve.org
- Ubuntu CVE tracker vendor-advisory
- github.com product