LiveActive security incident?Get immediate response
CVE Record

CVE-2026-41159: Mermaid: Improper sanitization of configuration leads to CSS injection

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.6 and 11.15.0, Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options. The injected CSS exploits stylis's & (scope reference) handling. :not(&) escapes the #mermaid-xxx automatic scoping, applying styles to all page elements. Global at-rules (@font-face, @keyframes, @counter-style) are also injectable as stylis hoists them to top level. This allows page defacement and DOM attribute exfiltration via CSS :has() selectors. This vulnerability is fixed in 10.9.6 and 11.15.0.

MediumCVSS 5.3Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

Mermaid can let attacker-controlled diagram configuration inject CSS that affects the surrounding web page, not just the diagram. Impact is mainly page defacement and limited data exposure through CSS-based techniques. This matters for products or internal portals that render Mermaid content from users or untrusted sources.

Executive priority

Treat as a near-term remediation for user-content platforms, documentation portals, and SaaS features that render Mermaid. It is not described as actively exploited, but it can affect page integrity and limited confidentiality if untrusted content is rendered.

Technical view

CVE-2026-41159 affects mermaid-js Mermaid before 10.9.6 and 11.15.0. Default configuration improperly sanitizes fontFamily, altFontFamily, and themeCSS. Stylis scope handling can let CSS escape Mermaid’s automatic scoping, and certain at-rules may be hoisted globally. CVSS v4.0 is 5.3.

Likely exposure

Exposure is most likely where web applications render Mermaid diagrams or accept Mermaid configuration from untrusted users, documents, wikis, issue trackers, or Markdown pipelines. Systems using only trusted, server-controlled diagrams have lower risk.

Exploitation context

The CVSS vector indicates network reachability, low complexity, no privileges, and required user interaction. The source bundle does not show CISA KEV listing or confirmed active exploitation. Abuse requires a victim application to render attacker-influenced Mermaid content or configuration.

Researcher notes

Focus review on Mermaid configuration sanitization and Stylis scoping behavior. The advisory names fontFamily, altFontFamily, themeCSS, :not(&) scope escape, and global at-rule hoisting. Avoid assuming broader XSS unless separately proven in the target application.

Mitigation direction

  • Upgrade Mermaid to 10.9.6 or 11.15.0, as applicable.
  • Identify applications that render untrusted Mermaid diagrams or configuration.
  • Restrict user control over Mermaid themeCSS, fontFamily, and altFontFamily settings.
  • Review Mermaid’s advisory and release notes for deployment-specific guidance.
  • Prioritize public-facing or multi-tenant Markdown and documentation platforms.

Validation and detection

  • Check package manifests and lockfiles for Mermaid versions below 10.9.6 or 11.15.0.
  • Confirm deployed bundles include the upgraded Mermaid release.
  • Map where Mermaid rendering accepts user-supplied diagrams or configuration.
  • Verify controls prevent untrusted CSS-related Mermaid configuration.
  • Review security tests for CSS escaping outside Mermaid diagram scope.
Prepared
Confidence
high
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-94: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-41159 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
5.3 (4.0)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
3Timeline events
1ADP providers
6Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: partial

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
5.3CVSS 4.0MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:LGitHub_M

Vulnerability scoring details

Base CVSS 4.0 score

5.3Medium
CVSS 4.0 vector shape for CVE-2026-41159Attack VectorAttack ComplexityAttack RequirementsPrivileges RequiredUser InteractionVS ConfidentialityVS IntegrityVS AvailabilitySS ConfidentialitySS IntegritySS Availability

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Attack Requirements
NonePresent
Privileges Required
NoneLowHigh
User Interaction
NonePassiveActive
VS Confidentiality
HighLowNone
VS Integrity
HighLowNone
VS Availability
HighLowNone
SS Confidentiality
HighLowNone
SS Integrity
HighLowNone
SS Availability
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
mermaid-jsmermaid>= 11.0.0-alpha.1, < 11.15.0, < 10.9.6Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-94 · source CWE mapping

Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.