High

Prototype pollution vulnerability found in Mermaid's bundled version of DOMPurify

  • Disclosed: 22.10.2024
  • Updated: 11.10.2026 10:22

The following bundled files within the Mermaid NPM package contain a bundled version of DOMPurify that is vulnerable to https://github.com/cure53/DOMPurify/security/advisories/GHSA-mmhx-hmjr-r674, potentially resulting in an XSS attack.

This affects the built:

  • dist/mermaid.min.js
  • dist/mermaid.js
  • dist/mermaid.esm.mjs
  • dist/mermaid.esm.min.mjs

This will also affect users that use the above files via a CDN link, e.g. https://cdn.jsdelivr.net/npm/mermaid@10.9.2/dist/mermaid.min.js

Users that use the default NPM export of mermaid, e.g. import mermaid from 'mermaid', or the dist/mermaid.core.mjs file, do not use this bundled version of DOMPurify, and can easily update using their package manager with something like npm audit fix.

Patches

  • develop branch: 6c785c93166c151d27d328ddf68a13d9d65adc00
  • backport to v10: 92a07ffe40aab2769dd1c3431b4eb5beac282b34

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package mermaid < 10.9.3 10.9.3

References

CVSS score 7/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L
Weakness (CWE)
CWE-1321, CWE-1395
Platform
npm
Package
mermaid
Disclosed
22.10.2024
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-m4gq-x24j-jpmf - CC BY 4.0

Vulnerability history: mermaid

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (16) in the archive
Total entries
16
First → latest
09.2020 08.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 3
  • Medium 12
  • Low 1

Disclosures per year

  1. 2020: 1
  2. 2021: 1
  3. 2022: 2
  4. 2023: 0
  5. 2024: 1
  6. 2025: 2
  7. 2026: 9
Severity:
  1. Prototype pollution vulnerability found in Mermaid's bundled version of DOMPurify this entry
    High · 7.0 ghsa-m4gq-x24j-jpmf < 10.9.3 10.9.3
  2. High · 7.2 CVE-2021-43861 < 8.13.8 8.13.8
  3. High ghsa-w32g-5hqp-gg6q < 8.2.3 8.2.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.