Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. mermaid
  4. ›
  5. CVE-2025-54881

CVE-2025-54881: Mermaid improperly sanitizes sequence diagram labels leading to XSS

August 19, 2025 (updated August 22, 2025)

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. Learn more about Dependency Scanning →

Affected versions

All versions starting from 10.9.0-rc.1 before 10.9.4, all versions starting from 11.0.0-alpha.1 before 11.10.0

Fixed versions

  • 11.10.0
  • 10.9.4

Solution

Upgrade to versions 10.9.4, 11.10.0 or above.

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/mermaid/CVE-2025-54881.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 23 Aug 2025 00:18:18 +0000.