Intel

AIKIDO-2026-10157

beautiful-mermaid is vulnerable to Cross-site Scripting (XSS)

Cross-site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Feb 10, 2026

61

Medium Risk

This Affects:

JSbeautiful-mermaid
0.1.0 - 0.1.2
Fixed in 0.1.3
Are you affected? Scan for Free

TL;DR

Affected versions of this package allow crafted Mermaid diagrams to inject arbitrary SVG attributes and elements because user-controlled values from style and classDef directives are interpolated into SVG attributes without proper escaping, enabling XSS and element injection. An attacker can exploit this by supplying malicious values that prematurely close SVG tags and inject new elements such as <svg onload> to execute JavaScript on render, or <image> tags to load external resources for data exfiltration.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

beautiful-mermaid is vulnerable to Cross-site Scripting (XSS) in versions 0.1.0 - 0.1.2.

How to fix this

Upgrade the beautiful-mermaid library to the patch version.