Impact
Mermaid's configuration APIs – mermaid.initialize, mermaidAPI.setConfig, and mermaidAPI.updateSiteConfig – merge caller‑supplied settings into the internal configuration using a deep‑merge helper that is vulnerable to prototype pollution. If an application forwards untrusted data to these entry points, an attacker could add or modify properties on JavaScript prototypes, potentially altering the behavior of Mermaid or other parts of the host application. The flaw is not triggered by the intended diagram‑supplied configuration syntax such as %%{init: {}}%% or YAML frontmatter, and therefore only affects code that incorrectly exposes the APIs to untrusted input.
Affected Systems
Affected versions are those of mermaid-js/mermaid older than 10.9.8 and 11.16.1. Any web application or documentation platform that incorporates those early releases and passes user‑controlled configuration to the mentioned APIs is at risk. The vulnerability applies to the JavaScript client library used to render diagrams on the front end or in Node.js environments.
Risk and Exploitability
The CVSS score of 2.4 indicates a low overall severity, and the vulnerability is not listed in CISA's KEV catalog. Exploitation is limited to environments where an attacker can inject configuration data into one of the APIs, which is outside documented usage. Consequently, the risk is low for properly audited deployments that do not expose the configuration setters to external input but remains a concern for applications that do.
OpenCVE Enrichment
Github GHSA