CVE-2026-50159: CWE-94: Improper Control of Generation of Code ('Code Injection') in mermaid-js mermaid
Mermaid versions prior to 10.9.8 and 11.16.1 are vulnerable to CSS injection via sibling combinator selectors generated from diagram-supplied class or id names. This allows an attacker who can supply diagram text to inject arbitrary CSS into the rendered page, potentially altering the appearance or behavior of unrelated page elements. The vulnerability is fixed in versions 10.9.8 and 11.16.1.
AI Analysis
Technical Summary
Mermaid, a JavaScript tool for creating diagrams from Markdown-inspired text, has a vulnerability identified as CVE-2026-50159 (CWE-94) involving improper control of code generation. Specifically, prior to versions 10.9.8 and 11.16.1, Mermaid's handling of diagram-supplied class or id names allows CSS injection through sibling combinator selectors. An attacker able to supply diagram text can inject arbitrary CSS into the rendered page, which may affect unrelated page elements' appearance or behavior. This issue is resolved in the stated fixed versions.
Potential Impact
An attacker who can supply diagram text to a vulnerable Mermaid instance can inject arbitrary CSS into the rendered page. This may lead to unauthorized changes in the page's appearance or behavior, potentially misleading users or interfering with page functionality. There is no indication of direct code execution or data disclosure from this vulnerability. The CVSS 4.0 score is 5.3 (medium severity), reflecting network attack vector, low complexity, no privileges required, user interaction needed, and limited impact on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in Mermaid versions 10.9.8 and 11.16.1. Users should upgrade to at least these versions to remediate the issue. No other mitigation guidance is provided or required.
CVE-2026-50159: CWE-94: Improper Control of Generation of Code ('Code Injection') in mermaid-js mermaid
Description
Mermaid versions prior to 10.9.8 and 11.16.1 are vulnerable to CSS injection via sibling combinator selectors generated from diagram-supplied class or id names. This allows an attacker who can supply diagram text to inject arbitrary CSS into the rendered page, potentially altering the appearance or behavior of unrelated page elements. The vulnerability is fixed in versions 10.9.8 and 11.16.1.
CVSS v4.0
Score 5.3medium
Affected software
pkg:npm/mermaid-js/mermaidRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Mermaid, a JavaScript tool for creating diagrams from Markdown-inspired text, has a vulnerability identified as CVE-2026-50159 (CWE-94) involving improper control of code generation. Specifically, prior to versions 10.9.8 and 11.16.1, Mermaid's handling of diagram-supplied class or id names allows CSS injection through sibling combinator selectors. An attacker able to supply diagram text can inject arbitrary CSS into the rendered page, which may affect unrelated page elements' appearance or behavior. This issue is resolved in the stated fixed versions.
Potential Impact
An attacker who can supply diagram text to a vulnerable Mermaid instance can inject arbitrary CSS into the rendered page. This may lead to unauthorized changes in the page's appearance or behavior, potentially misleading users or interfering with page functionality. There is no indication of direct code execution or data disclosure from this vulnerability. The CVSS 4.0 score is 5.3 (medium severity), reflecting network attack vector, low complexity, no privileges required, user interaction needed, and limited impact on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in Mermaid versions 10.9.8 and 11.16.1. Users should upgrade to at least these versions to remediate the issue. No other mitigation guidance is provided or required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-03T20:54:20.432Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a750706bf8831d5395f5a96
Added to database: 08/06/2026, 22:13:26 UTC
Last enriched: 08/06/2026, 22:58:00 UTC
Last updated: 08/07/2026, 01:06:35 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.