Incorrect sanitisation function leads to `XSS`
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
Mermaid is a Javascript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. Prior to version 8.13.8, malicious diagrams can run javascript code at diagram readers' machines. Users should upgrade to version 8.13.8 to receive a patch. There are no known workarounds aside from upgrading.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| mermaid-js | mermaid | before 8.13.8 | 8.13.8 | Patch available | CNA |
| — | mermaid (npm) | before 8.13.8 | 8.13.8 | Patch available | GHSA-p3rp-vmj9-gv6v |
- mermaid Vendormermaid-js Affected before 8.13.8 Fixed in 8.13.8 Patch available CNA
- mermaid (npm) Vendor— Affected before 8.13.8 Fixed in 8.13.8 Patch available GHSA-p3rp-vmj9-gv6v
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:* | before 8.13.8 | Vulnerable | mermaid-js |
- cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:* Versions before 8.13.8 Vulnerable ·mermaid-js
Remediation
- Fix · CNA mermaid (mermaid-js) Fixed in 8.13.8
- Fix · GHSA-p3rp-vmj9-gv6v mermaid (npm) Fixed in 8.13.8 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-43861
- 2026-10-03 Alias added: GHSA-p3rp-vmj9-gv6v
References
Advisory 3
More mermaid-js Mermaid vulnerabilities
- TI-2026-29778 Mermaid Gantt Charts are vulnerable to an Infinite Loop DoS CVSS 4.0MEDIUM 5.3
- TI-2022-13152 Arbitrary `CSS` injection into the generated graph affecting the container HTML in mermaid.js CVSS 3.1MEDIUM 6.1
- TI-2025-34614 Mermaid does not properly sanitize architecture diagram iconText leading to XSS CVSS 4.0MEDIUM 5.1
- TI-2021-14247 Mermaid before 8.11.0 allows XSS when the antiscript feature is used. CVSS 3.1MEDIUM 6.1
- TI-2026-29785 Mermaid: Improper sanitization of configuration leads to CSS injection CVSS 4.0MEDIUM 5.3
Sources
- CVE-2021-43861 · CVE Program
- CVE-2021-43861 · NVD
- FIRST EPSS
- GHSA-p3rp-vmj9-gv6v · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences