CVE-2026-71438: Mermaid configuration APIs allow prototype pollution
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.
References
- github.com/advisories/GHSA-c4c3-pg64-4m4v
- github.com/mermaid-js/mermaid/commit/2cd6dcf735533b323507e3e889ffdea870540b43
- github.com/mermaid-js/mermaid/commit/c34b07a0815842327e70794d69b0c8c5a1e2a956
- github.com/mermaid-js/mermaid/pull/8022
- github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.16.1
- github.com/mermaid-js/mermaid/releases/tag/v10.9.8
- github.com/mermaid-js/mermaid/security/advisories/GHSA-c4c3-pg64-4m4v
- nvd.nist.gov/vuln/detail/CVE-2026-71438
Code Behaviors & Features
Detect and mitigate CVE-2026-71438 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →