---
id: CVE-2026-50159
title: >-
  Mermaid is a JavaScript tool that uses Markdown-inspired text to create and
  modify diagrams and charts
summary: >-
  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 …
severity: medium
cwe:
  - CWE-94
vendor: mermaid
product: mermaid
affected:
  - 'mermaid >= 11.0.0-alpha.1, < 11.16.1'
  - mermaid < 10.9.8
patched:
  - mermaid 11.16.1
  - mermaid 10.9.8
published: '2026-08-06'
updated: '2026-09-08'
sourceUpdated: '2026-09-08T20:53:06.753'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-50159'
references:
  - url: >-
      https://github.com/mermaid-js/mermaid/commit/12d472c9ed43f94814b110da8d7a9ae6dd5266ed
    label: security-advisories@github.com
  - url: >-
      https://github.com/mermaid-js/mermaid/commit/7e83f1533318b307764d961906a73377266f4c5e
    label: security-advisories@github.com
  - url: 'https://github.com/mermaid-js/mermaid/pull/8022'
    label: security-advisories@github.com
  - url: 'https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.16.1'
    label: security-advisories@github.com
  - url: 'https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8'
    label: security-advisories@github.com
  - url: >-
      https://github.com/mermaid-js/mermaid/security/advisories/GHSA-6x64-9x62-f2gx
    label: security-advisories@github.com
  - url: 'https://github.com/advisories/GHSA-6x64-9x62-f2gx'
tags:
  - nvd
  - ghsa
  - npm
epss: 0.00603
epssPercentile: 0.46595
aliases:
  - GHSA-6x64-9x62-f2gx
ecosystem: npm
ingestedAt: '2026-08-06T20:03:56.388Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-50159)

Affected packages:

- `mermaid >= 11.0.0-alpha.1, < 11.16.1`
- `mermaid < 10.9.8`

Patched in:

- `mermaid 11.16.1`
- `mermaid 10.9.8`

Source: https://github.com/advisories/GHSA-6x64-9x62-f2gx
