Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted architecture-beta diagram with __proto__ group id
-
DeliveryMermaid parser accepts __proto__ as valid parent without sanitization
-
ExploitLayout direction property written onto Object.prototype
-
ExecutionDownstream application code reads poisoned property from arbitrary object
-
ImpactLogic corruption or denial of service in embedding application
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires two concrete conditions: first, the application must accept untrusted Mermaid diagram source text and pass it to the Mermaid renderer without stripping or validating diagram type; second, the diagram must use the 'architecture-beta' diagram type (diagrams using other Mermaid types such as flowchart, sequence, or gantt are not affected by this vulnerability). No authentication is required on the attacker's side if the host application allows anonymous diagram submission. Exploitation effect is further limited by the constrained injectable value - only the strings 'horizontal' or 'vertical' can be written to Object.prototype, meaning the realistic harm is logic corruption in code that reads a property of that name from an arbitrary object, or for...in loop contamination - not code execution. Applications running Mermaid in an isolated Web Worker or sandbox with a separate JavaScript realm are not affected even if they use architecture-beta diagrams, because the polluted prototype does not cross realm boundaries. |
| Impact | No CVSS score or EPSS probability was provided for this CVE, so quantitative risk ranking is not possible. KEV status is negative - no confirmed active exploitation by CISA. A working proof-of-concept is publicly available in the GitHub security advisory (GHSA-3rrr-jr9j-h3q3), which meaningfully lowers the bar for exploitation. The real-world impact is bounded by two factors: (1) the injected value is always a plain string ('horizontal' or 'vertical'), not a function or object, so arbitrary code execution via prototype pollution is not possible with this specific gadget; (2) actual harm depends entirely on whether any code in the hosting application's JavaScript realm reads the polluted property name from an arbitrary object or uses bare for...in enumeration. Applications that embed Mermaid for user-submitted diagrams (wikis, documentation platforms, SaaS tools) and have business logic that reads dynamic object properties are meaningfully at risk of logic corruption or DoS. Applications where diagrams are authored only by trusted parties face no practical risk. The 'RCE' tag in the source intelligence is misleading - the advisory explicitly states RCE is not directly achievable; that tag should be disregarded for decision-making. |
| Exploit ScenarioDerived | An attacker submits a crafted Mermaid diagram beginning with 'architecture-beta' to a documentation platform or wiki that renders user-supplied diagrams, using '__proto__' as a service's group parent identifier. When the platform renders the diagram server-side or in a shared browser context, Object.prototype is silently polluted with a string property. Subsequent requests processed in the same Node.js worker or browser tab may experience corrupted configuration defaults or logic branches that read the property, potentially causing application errors or denial of service for other users sharing that realm. A working PoC is publicly documented in GHSA-3rrr-jr9j-h3q3. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 06, 2026
Prototype pollution in Mermaid's architecture-beta diagram renderer (mermaid@11.5.0 through 11.16.0) allows an untrusted diagram author to write the string 'horizontal' or 'vertical' directly onto Object.prototype by supplying '__proto__' as a valid group parent identifier. All JavaScript code sharing the same runtime realm that reads or enumerates the injected property name may observe corrupted option defaults, bypassed truthiness checks, or denial-of-service conditions in the embedding application. A public proof-of-concept is included in the advisory; direct remote code execution is not achievable because the injectable value is constrained to those two strings, ruling out function or object injection.
RemediationAI
Upgrade to mermaid@11.16.1 or later, which resolves this issue by replacing prototype-vulnerable plain-object group storage with ES6 Map and Set structures (commit 99af3fc35ef0a9a9c8c6314521344d67523ddcommit, PR https://github.com/mermaid-js/mermaid/pull/8022; release notes at https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.16.1). The upstream advisory explicitly states there are no known workarounds short of patching. If an immediate upgrade is not possible, a compensating control is to disable or block rendering of architecture-beta diagram type at the application layer - reject or strip diagram content that begins with the 'architecture-beta' keyword before it reaches the Mermaid renderer. This eliminates exposure to this specific vector but may break legitimate architecture diagram functionality. Blanket disabling of user-submitted diagram rendering is an alternative with a higher operational cost.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes - Prototype Pollution) describes the root cause precisely: the architecture-beta diagram parser stores group parent relationships in a plain JavaScript object without sanitizing reserved keys. When a service declares 'in __proto__', the parser traverses the prototype chain and writes the layout direction property ('horizontal' or 'vertical') onto Object.prototype itself rather than a diagram-owned object. Because JavaScript's prototype chain is shared across all objects in a realm, every subsequent property lookup on an arbitrary object in the same realm may observe the injected value. The affected npm package is pkg:npm/mermaid versions >= 11.5.0 (introduced in commit cb0a4703bdf01d47508bde1c08aa9a980d70bc20) through < 11.16.1. The fix (commit 99af3fc35ef0a9a9c8c6314521344d67523ddccf, PR #8022) migrates group and service storage from plain objects to ES6 Map and Set structures, which are immune to __proto__ prototype traversal.
Know when Prototype Pollution gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-reachable via untrusted diagram input, no auth or interaction needed for automated rendering, scope changed because pollution crosses into the embedding application's realm.
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
Primary rating from Vendor (https://github.com/mermaid-js/mermaid).
CVSS VectorVendor: https://github.com/mermaid-js/mermaid
Lifecycle Timeline
1DescriptionCVE.org
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:bThe 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?_
- https://github.com/mermaid-js/mermaid/commit/99af3fc35ef0a9a9c8c6314521344d67523ddccf
- https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.16.1
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
More in Prototype Pollution
View allPrototype pollution in Adobe Acrobat Reader versions 24.001.30356, 26.001.21367 and earlier enables arbitrary code execu
All versions of package dojo are vulnerable to Prototype Pollution via the setObject function. Rated critical severity (
Prototype pollution in the farinspace Partners WordPress plugin (versions up to and including 0.2.0) enables remote unau
The package handlebars before 4.7.7 are vulnerable to Prototype Pollution when selecting certain compiling options to co
This affects the package ini before 1.3.6. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitabl
Prototype pollution vulnerability in 'deephas' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service
A Prototype Pollution issue in Cronvel Tree-kit v.0.7.4 and before allows a remote attacker to execute arbitrary code vi
A Prototype Pollution issue in Aliconnect /sdk v.0.0.6 allows an attacker to execute arbitrary code via the aim function
All versions of the package safe-eval are vulnerable to Prototype Pollution via the safeEval function, due to improper s
This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr
Prototype Pollution in chargeover redoc v2.0.9-rc.69 allows attackers to execute arbitrary code or cause a Denial of Ser
alizeait unflatto <= 1.0.2 was discovered to contain a prototype pollution via the method exports.unflatto at /dist/inde
EUVD-2026-54242
GHSA-3rrr-jr9j-h3q3
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB