Cross-site scripting in mermaid - CVE-2022-31108
Published: June 28, 2022 / Updated: April 24, 2026
mermaid
mermaid-js
Description
The vulnerability allows a remote attacker to inject arbitrary CSS into the generated graph affecting the container HTML.
The vulnerability exists due to improper neutralization of input in the graph rendering logic when rendering crafted diagram content. A remote attacker can supply crafted content to inject arbitrary CSS into the generated graph affecting the container HTML.