CVE-2021-43861
MEDIUM 5.4CVSS 3.1Incorrect sanitisation function leads to `XSS` in mermaid
Mermaid is a Javascript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. Prior to version 8.13.8, malicious diagrams can run javascript code at diagram readers' machines. Users should upgrade to version 8.13.8 to receive a patch. There are no known workarounds aside from upgrading.
- Published
- 30 Dec 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-20CWE-79
- Also known as
- GHSA-p3rp-vmj9-gv6v
- Sources
- NVDJSONOSV GHSA-p3rp-vmj9-gv6vJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.2 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.2 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | LOW 3.5 | AV:N/AC:M/Au:S/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | mermaid_project | mermaidcpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:* |
< 8.13.8 | 8.13.8 |
| OSV | npm | mermaid | < 8.13.8 | 8.13.8 |
References
- https://github.com/mermaid-js/mermaid/commit/066b7a0d0bda274d94a2f2d21e4323dab5776d83 · Patch, Third Party Advisory, WEB
- https://github.com/mermaid-js/mermaid/releases/tag/8.13.8 · Release Notes, Third Party Advisory, WEB
- https://github.com/mermaid-js/mermaid/security/advisories/GHSA-p3rp-vmj9-gv6v · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-43861 · ADVISORY
- https://github.com/mermaid-js/mermaid · PACKAGE
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 30 Dec 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 6 Jan 2022)