Low

Mermaid configuration APIs allow prototype pollution

  • Disclosed: 06.08.2026
  • Updated: 11.10.2026 10:22

Summary

Mermaid's configuration setters (mermaid.initialize, mermaidAPI.setConfig, and mermaidAPI.updateSiteConfig) merge the caller-supplied configuration object into Mermaid's internal config using the assignWithDepth deep-merge helper that is vulnerable to prototype pollution.

Because these APIs are intended to receive trusted configuration supplied by the application integrating Mermaid, Mermaid assesses the practical risk as low. The vulnerability is only reachable if an application forwards attacker-controlled data directly into one of these configuration entry points, which is outside their documented usage.

User-controlled configuration (e.g. configuration in diagram code using %%{init: {}}%% or YAML frontmatter) are already protected from prototype pollution.

Patches

This has been patched in https://github.com/mermaid-js/mermaid/commit/2cd6dcf735533b323507e3e889ffdea870540b43 and released in Mermaid v11.16.1.

A backport has been made for the v10 branch in c34b07a0815842327e70794d69b0c8c5a1e2a956 and was released in Mermaid v10.9.8

Impact

Mermaid believes it's unlikely that anybody is impacted, as these functions are configuration entry points expected to receive trusted, developer-controlled values as they can modify other security-relevant configuration.

Workarounds

Don't pass user-controlled data to the mermaid.initialize, mermaidAPI.setConfig, and mermaidAPI.updateSiteConfig functions. Instead, users can use %%{init: {}}%% or YAML frontmatter in diagrams.

Reporters

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package mermaid >= 11.0.0-alpha.1, < 11.16.1, < 10.9.8 11.16.1, 10.9.8

References

CVSS score -
CVSS vector
CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:A/VC:N/VI:L/VA:L/SC:H/SI:H/SA:H
Weakness (CWE)
CWE-1321
Platform
npm
Package
mermaid
Disclosed
06.08.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-c4c3-pg64-4m4v - 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. Mermaid configuration APIs allow prototype pollution this entry
    Low CVE-2026-71438 >= 11.0.0-alpha.1, < 11.16.1, < 10.9.8 11.16.1, 10.9.8
  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.