6.5medium
Mermaid Architecture diagrams are vulnerable to prototype pollution
- Severity
- 6.5medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.50% (higher than 36% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3rrr-jr9j-h3q3
Description
Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. From version 11.5.0 until 11.16.1, Mermaid Architecture Diagrams are vulnerable to prototype pollution when a diagram defines a group with an id of __proto__. Because the group id is used directly as an object property key without validation, an attacker who can supply diagram text can pollute Object.prototype, potentially affecting the behavior of the embedding application. This issue is fixed in version 11.16.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| mermaid-js mermaid | >= 11.5.0, < 11.16.1 | CVE List |
| mermaid (npm) | from 11.5.0 before 11.16.1 | GitHub Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:H/SI:H/SA:H |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:H/SI:H/SA:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. From version 11.5.0 until 11.16.1, Mermaid Architecture Diagrams are vulnerable to prototype pollution when a diagram defines a group with an id of __proto__. Because the group id is used directly as an object property key without validation, an attacker who can supply diagram text can pollute Object.prototype, potentially affecting the behavior of the embedding application. This issue is fixed in version 11.16.1.
GitHub Advisory Database
Rendering an untrusted architecture-beta diagram lets the diagram author write an arbitrary property with the value horizontal or vertical onto Object.prototype. A group id of __proto__ is accepted as a valid parent.
Impact
Any code in the same realm that reads a property of that name from an arbitrary object, or enumerates an object with bare for...in, observes the injected value (which can only be the string horizontal or vertical.
This may mean corrupted option/config defaults, bypassed truthiness checks, causing denial of service or logic corruption in the embedding application.
Because the injected value cannot be an object or function, this is not directly exploitable for remote code execution.
PoC
architecture-beta
group mermaidPrototypePollutionMarker(cloud)[Marker]
service a(server)[A] in __proto__
service b(server)[B] in mermaidPrototypePollutionMarker
a:R -- L:b
The vulnerable write was introduced in commit cb0a4703bdf01d47508bde1c08aa9a980d70bc20 and first shipped in mermaid@11.5.0. The lines are unchanged in every release since.
Patches
This has been patched by https://github.com/mermaid-js/mermaid/commit/99af3fc35ef0a9a9c8c6314521344d67523ddccf, released in Mermaid v11.16.1
Workarounds
There are no known workarounds. Please update to a patched version.
References
Are there any links users can visit to find out more?
NVD (es)
Mermaid es una herramienta de JavaScript que utiliza texto inspirado en Markdown para crear y modificar diagramas y gráficos. Desde la versión 11.5.0 hasta la 11.16.1, los diagramas de arquitectura de Mermaid son vulnerables a la contaminación de prototipos cuando un diagrama define un grupo con un ID de __proto__. Debido a que el ID del grupo se utiliza directamente como clave de propiedad de objeto sin validación, un atacante que puede proporcionar texto de diagrama puede contaminar Object.prototype, afectando potencialmente el comportamiento de la aplicación incrustada. Este problema está solucionado en la versión 11.16.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-71437 changed 2026-08-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3rrr-jr9j-h3q3 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-71437 changed 2026-10-24 | Public domain |