Mermaid improperly sanitizes of sequence diagram labels leading to XSS
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- None · None · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| mermaid-js | mermaid | 10.9.0-rc.1 – 11.9.0 | — | No fix listed | CNA |
| — | mermaid (npm) | 11.0.0-alpha.1 to before 11.10.0 | 11.10.0 | Patch available | GHSA-7rqq-prvp-x9jh |
| — | mermaid (npm) | 10.9.0-rc.1 to before 10.9.4 | 10.9.4 | Patch available | GHSA-7rqq-prvp-x9jh |
- mermaid Vendormermaid-js Affected 10.9.0-rc.1 – 11.9.0 Fixed in — No fix listed CNA
- mermaid (npm) Vendor— Affected 11.0.0-alpha.1 to before 11.10.0 Fixed in 11.10.0 Patch available GHSA-7rqq-prvp-x9jh
- mermaid (npm) Vendor— Affected 10.9.0-rc.1 to before 10.9.4 Fixed in 10.9.4 Patch available GHSA-7rqq-prvp-x9jh
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:*:*:* | — | — | mermaid-js |
- cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:*:*:* Versions — — ·mermaid-js
Remediation
- Fix · GHSA-7rqq-prvp-x9jh mermaid (npm) Fixed in 11.10.0 Advisory →
- Fix · GHSA-7rqq-prvp-x9jh mermaid (npm) Fixed in 10.9.4 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2025-54881
- 2026-10-03 Alias added: GHSA-7rqq-prvp-x9jh
References
More mermaid-js vulnerabilities
- TI-2026-29778 Mermaid Gantt Charts are vulnerable to an Infinite Loop DoS CVSS 4.0MEDIUM 5.3
- TI-2026-50057 Mermaid Architecture diagrams are vulnerable to prototype pollution CVSS 4.0MEDIUM 6.5
- TI-2022-13152 Arbitrary `CSS` injection into the generated graph affecting the container HTML in mermaid.js CVSS 3.1MEDIUM 6.1
- TI-2024-25762 Cross-site Scripting in ZenUML CVSS 3.1MEDIUM 5.4
- TI-2026-29777 Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection CVSS 4.0MEDIUM 5.3
- TI-2025-34614 Mermaid does not properly sanitize architecture diagram iconText leading to XSS CVSS 4.0MEDIUM 5.1
Sources
- CVE-2025-54881 · CVE Program
- CVE-2025-54881 · NVD
- FIRST EPSS
- GHSA-7rqq-prvp-x9jh · GitHub Advisory Database · CC BY 4.0
- CVE-2025-54881 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences