Skip to content
OpenAdvisories
Medium · 5.3 CVE-2025-54881 EUVD-2025-28574GHSA-7rqq-prvp-x9jh

Mermaid improperly sanitizes of sequence diagram labels leading to XSS

Published Aug 19, 2025 · Updated Aug 19, 2025 · Assigned by GitHub_M

Description

Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. In the default configuration of mermaid 10.9.0-rc.1 to 11.9.0, user supplied input for sequence diagram labels is passed to innerHTML during calculation of element size, causing XSS.

Affected products

VendorProductAffectedFixed
mermaid-js mermaid >= 10.9.0-rc.1, <= 11.9.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 26.10 node-mermaid No fix yet —
Ubuntu 22.04 LTS node-mermaid No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
npm mermaid >= 11.0.0-alpha.1, < 11.10.0 11.10.0 GHSA-7rqq-prvp-x9jh
npm mermaid >= 10.9.0-rc.1, < 10.9.4 10.9.4 GHSA-7rqq-prvp-x9jh

References