Vulnerabilities/

Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection

Severity:
Medium

Description

Under the default configuration, Mermaid state diagram’s classDef allow DOM injection that escapes the SVG, although <script> tags are removed, preventing XSS.

Recommendation

Update the mermaid package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
mermaid
Anything's wrong? Let us know Last updated on May 12, 2026