CVE-2021-35513: Cross-site Scripting in Mermaid
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.53429%
CWE
Published
12/10/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
mermaid | npm | < 8.11.0 | 8.11.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from insufficient input sanitization in the antiscript security feature. The commit 3d22fa5 shows the vulnerable version lacked: 1) replacement of 'javascript:' with '#', and 2) removal of <iframe> tags. The test case in xss5.html
demonstrates XSS via a crafted 'javascript:' URL with encoded characters. The removeScript
function was directly patched to add these sanitization steps, confirming it was the vulnerable component.