{"id":"CVE-2021-43861","published":"2021-12-30T13:40:11Z","modified":"2024-08-04T04:10:17Z","title":"Incorrect sanitisation function leads to `XSS`","vendor":"mermaid-js","product":"mermaid","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.2,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00938,"percentile":0.59232,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"},{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/mermaid-js/mermaid/security/advisories/GHSA-p3rp-vmj9-gv6v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/mermaid-js/mermaid/commit/066b7a0d0bda274d94a2f2d21e4323dab5776d83","tags":["x_refsource_MISC"]},{"url":"https://github.com/mermaid-js/mermaid/releases/tag/8.13.8","tags":["x_refsource_MISC"]}],"priority":{"score":16.9,"factors":[{"name":"EPSS percentile","points":11.85},{"name":"CVSS severity","points":5.04}]},"vendorSlug":"mermaid-js","affectedVersions":[{"vendor":"mermaid-js","product":"mermaid","versions":["< 8.13.8"]}],"affected":[{"ecosystem":"npm","package":"mermaid","vulnerableRanges":["<8.13.8"],"patched":["8.13.8"],"from":["GHSA-p3rp-vmj9-gv6v"],"provenance":"source"}],"summary":{"text":"Mermaid, the JavaScript diagramming and charting tool, contains an incorrect input sanitisation flaw in its diagram rendering that leads to cross-site scripting. Where a malicious diagram is rendered in a reader's browser, the attacker's JavaScript can run in that reader's session, but only if the affected version of Mermaid is in use and the diagram is supplied to that reader.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:47:38Z"},"euvd":{"id":"EUVD-2022-0654","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-35513","published":"2021-06-27","fixed":"8.11.0","kev":false,"link":{"from":"CVE-2021-35513","to":"CVE-2021-43861","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:mermaid","fromFixed":"8.11.0","toFixed":"8.13.8","daysApart":186}]}},{"cve":"CVE-2021-43861","published":"2021-12-30","fixed":"8.13.8","kev":false},{"cve":"CVE-2022-31108","published":"2022-06-28","fixed":"9.1.2","kev":false},{"cve":"CVE-2025-54880","published":"2025-08-19","fixed":"11.10.0","kev":false},{"cve":"CVE-2025-54881","published":"2025-08-19","fixed":"11.10.0","kev":false}],"package":"npm:mermaid"}}