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.

Severity (CVSS 4.0)5.3Medium
Exploit odds (30 days)0.6%top 51.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:14node-mermaidno fix listedDEBIAN-CVE-2026-50159
Ubuntu:22.04:LTSnode-mermaidno fix listedUBUNTU-CVE-2026-50159
Ubuntu:26.10node-mermaidno fix listedUBUNTU-CVE-2026-50159
npmmermaid11.16.1GHSA-6x64-9x62-f2gx
npmmermaid10.9.8GHSA-6x64-9x62-f2gx

Affected products (as reported)

VendorProductVersions
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