CVE-2025-54881: Mermaid improperly sanitizes sequence diagram labels leading to XSS
(updated )
In the default configuration of mermaid 11.9.0, user supplied input for sequence diagram labels is passed to innerHTML during calculation of element size, causing XSS.
References
- github.com/advisories/GHSA-7rqq-prvp-x9jh
- github.com/mermaid-js/mermaid
- github.com/mermaid-js/mermaid/commit/5c69e5fdb004a6d0a2abe97e23d26e223a059832
- github.com/mermaid-js/mermaid/commit/685516a85ec1df64cefd4fd15f26533be87d458e
- github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh
- nvd.nist.gov/vuln/detail/CVE-2025-54881
Code Behaviors & Features
Detect and mitigate CVE-2025-54881 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →