Read the docs
TI-2021-19667 Aliases CVE-2021-43861GHSA-p3rp-vmj9-gv6v

Incorrect sanitisation function leads to `XSS`

Priority LOW 33CWE-20Published · Updated

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

EPSS 0.00938 61st percentileScored 2026-11-07
Fix Fixed mermaid (mermaid-js): 8.13.8mermaid (npm): 8.13.8

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
mermaid-jsmermaidbefore 8.13.88.13.8Patch availableCNA
—mermaid (npm)before 8.13.88.13.8Patch availableGHSA-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

CPEVersionsRoleVendor
cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*before 8.13.8Vulnerablemermaid-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

  1. 2026-10-02 Threatist record created from CVE-2021-43861
  2. 2026-10-03 Alias added: GHSA-p3rp-vmj9-gv6v

References

  • 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