Vulnerability · Published Aug 6, 2026 · Assigned by GitHub_M
CVE-2026-50159Mermaid allows CSS injection applying to sibling elements of the diagram
Medium 5.3
In plain English
A medium-severity code injection in mermaid from mermaid-js. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 49% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.8 and 11.16.1, Mermaid is vulnerable to CSS injection via sibling combinator selectors generated from diagram-supplied class or id names. An attacker who can supply diagram text can inject arbitrary CSS into the rendered page, potentially altering the appearance or behavior of unrelated page elements. This issue is fixed in versions 10.9.8 and 11.16.1.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:14 | node-mermaid | no fix listed | DEBIAN-CVE-2026-50159 |
| Ubuntu:22.04:LTS | node-mermaid | no fix listed | UBUNTU-CVE-2026-50159 |
| Ubuntu:26.10 | node-mermaid | no fix listed | UBUNTU-CVE-2026-50159 |
| npm | mermaid | 11.16.1 | GHSA-6x64-9x62-f2gx |
| npm | mermaid | 10.9.8 | GHSA-6x64-9x62-f2gx |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| mermaid-js | mermaid | < 10.9.8>= 11.0.0-alpha.1, < 11.16.1 |
Weakness: CWE-94 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L
References
- https://github.com/mermaid-js/mermaid/security/advisories/GHSA-6x64-9x62-f2gx x_refsource_CONFIRM
- https://github.com/mermaid-js/mermaid/pull/8022 x_refsource_MISC
- https://github.com/mermaid-js/mermaid/commit/12d472c9ed43f94814b110da8d7a9ae6dd5266ed x_refsource_MISC
- https://github.com/mermaid-js/mermaid/commit/7e83f1533318b307764d961906a73377266f4c5e x_refsource_MISC
- https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.16.1 x_refsource_MISC
- https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8 x_refsource_MISC