CVE-2026-41159 Mermaid: Improper sanitization of configuration leads to CSS injection
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · 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. Prior to 10.9.6 and 11.15.0, Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options. The injected CSS exploits stylis's & (scope reference) handling. :not(&) escapes the #mermaid-xxx automatic scoping, applying styles to all page elements. Global at-rules (@font-face, @keyframes, @counter-style) are also injectable as stylis hoists them to top level. This allows page defacement and DOM attribute exfiltration via CSS :has() selectors. This vulnerability is fixed in 10.9.6 and 11.15.0.
Upgrade path
9 packages: 2 fixed, 6 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/devspaces/code-rhel9(Red Hat openshift_devspaces 3) | All versions | 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 |
| mermaid project mermaid | < 10.9.6; >= 11.0.0, < 11.15.0 | 10.9.6, 11.15.0 | Fixed |
| 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 |
| redhat/devspaces/code-rhel9(Red Hat:openshift_devspaces:3) | 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 |
Show 5 more
| Product | Affected versions | Fixed in |
|---|---|---|
| ubuntu/node-mermaid(Ubuntu:26.10) | All versions | No fix listed |
| mermaid project mermaid | < 10.9.6 | 10.9.6 |
| mermaid project mermaid | >= 11.0.0, < 11.15.0 | 11.15.0 |
| 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-87f9-hvmw-gh4p third-party-advisory vendor-advisory
- https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aa patch
- https://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76 patch
- https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.15.0 release-notes
- https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6 release-notes
- Debian Security Tracker CVE-2026-41159 vendor-advisory
- bugs.debian.org issue-tracking
- github.com
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com
- Red Hat CVE page mitigation vendor-advisory
- Red Hat Bugzilla 2483294 issue-tracking
- www.cve.org
- github.com
- Ubuntu CVE tracker vendor-advisory
- github.com product