Skip to main content
EPSS 0.6%top 52%

CVE-2026-50159: CWE-94: Improper Control of Generation of Code ('Code Injection') in mermaid-js mermaid

0
Medium
Published: 08/06/2026 (08/06/2026, 19:55:27 UTC)
Source: CVE Database V5
Vendor/Project: mermaid-js
Product: 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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vuln. Confidentiality
None
Vuln. Integrity
Low
Vuln. Availability
None
Subsq. Confidentiality
Low
Subsq. Integrity
Low
Subsq. Availability
Low
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

Affected software

mermaid-js

mermaid

Affected versions
<10.9.8>=11.0.0-alpha.1 <11.16.1
mermaid-js/mermaid
pkg:npm/mermaid-js/mermaid
Affected versions
<10.9.8>=11.0.0 <11.16.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/14/2026, 16:06:11 UTC

Technical Analysis

Mermaid, a JavaScript tool for creating diagrams from Markdown-inspired text, has a vulnerability classified as CWE-94 (Improper Control of Generation of Code) that allows CSS injection. Specifically, prior to versions 10.9.8 and 11.16.1, Mermaid generates sibling combinator selectors from user-supplied diagram class or id names without proper sanitization, enabling an attacker who can supply diagram text to inject arbitrary CSS into the rendered page. This can affect unrelated page elements' appearance or behavior. The issue is resolved in versions 10.9.8 and 11.16.1.

Potential Impact

An attacker able to supply diagram text can inject arbitrary CSS into pages rendered by vulnerable Mermaid versions, potentially manipulating the visual presentation or behavior of unrelated elements on the page. This could lead to UI manipulation or visual spoofing but does not directly indicate code execution or data compromise. 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

Upgrade Mermaid to version 10.9.8 or later, or 11.16.1 or later, where this CSS injection vulnerability is fixed. No other mitigation is indicated or required according to the available data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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

Threat ID: 6a750706bf8831d5395f5a96

Added to database: 08/06/2026, 22:13:26 UTC

Last enriched: 08/14/2026, 16:06:11 UTC

Last updated: 09/21/2026, 22:01:35 UTC

Views: 42

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses