Cross-Site Scripting in mermaid
Versions of mermaid prior to 8.2.3 are vulnerable to Cross-Site Scripting. If malicious input such as A["<img src=invalid onerror=alert('XSS')></img>"] is provided to the application, it will execute the code instead of rendering it as text due to improper output encoding.
Recommendation
Upgrade to version 8.2.3 or later
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | mermaid | < 8.2.3 | 8.2.3 |
References
- Weakness (CWE)
CWE-79- Platform
- npm
- Package
mermaid- Disclosed
- 02.09.2020
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-w32g-5hqp-gg6q - CC BY 4.0
Vulnerability history: mermaid
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 16
- First → latest
- 09.2020 08.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 3
- Medium 12
- Low 1
Disclosures per year
- 2020: 1
- 2021: 1
- 2022: 2
- 2023: 0
- 2024: 1
- 2025: 2
- 2026: 9
-
Cross-Site Scripting in mermaid this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.