Cross-site scripting in mermaid - CVE-2021-43861
Published: December 29, 2021 / Updated: April 24, 2026
mermaid
mermaid-js
Description
The vulnerability allows a remote attacker to execute arbitrary script code in the victim's browser.
The vulnerability exists due to cross-site scripting in the diagram rendering functionality when processing malicious diagrams. A remote attacker can supply a specially crafted diagram to execute arbitrary script code in the victim's browser.
User interaction is required to view the crafted diagram.