CVE-2026-71438: Mermaid configuration APIs allow prototype pollution
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.
Published Aug 6, 2026
Affected packages
mermaid
- Ecosystem
- npm
- Affected
- >= 11.0.0-alpha.1, < 11.16.1
- Fixed in
- 11.16.1
- Check
npm ls mermaid
mermaid
- Ecosystem
- npm
- Affected
- < 10.9.8
- Fixed in
- 10.9.8
- Check
npm ls mermaid
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
- [email protected] (Liyi), https://lzhou1110.github.io/
- [email protected] (Ziyue), https://zyy0530.github.io/
- [email protected] (Strick), https://str1ckl4nd.github.io/
- [email protected] (Maurice), http://maurice.busystar.org/
- [email protected] (Chenchen), https://7thparkk.github.io/
Credited to Str1ckl4nd, Zyy0530, 7thParkk, mauriceng98, aloisklink.
References
- https://github.com/mermaid-js/mermaid/security/advisories/GHSA-c4c3-pg64-4m4v
- https://github.com/mermaid-js/mermaid/pull/8022
- https://github.com/mermaid-js/mermaid/commit/2cd6dcf735533b323507e3e889ffdea870540b43
- https://github.com/mermaid-js/mermaid/commit/c34b07a0815842327e70794d69b0c8c5a1e2a956
- https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.16.1
- https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8
- https://github.com/advisories/GHSA-c4c3-pg64-4m4v
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-50159
Mermaid allows CSS injection applying to sibling elements of the diagram
medium5.3Aug 6, 2026CVE-2026-71436
Mermaid XY Charts are vulnerable to an infinite loop DoS
medium5.3Aug 6, 2026CVE-2026-71437
Mermaid Architecture diagrams are vulnerable to prototype pollution
medium6.5Aug 6, 2026CVE-2026-71439
Mermaid radar diagrams are vulnerable to DoS
medium5.3Aug 6, 2026CVE-2026-41148
Mermaid: Improper sanitization of `classDefs` in diagrams leads to CSS injection
medium5.3May 11, 2026CVE-2026-41149
Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection
medium5.3May 11, 2026
