{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-41149","id":"CVE-2026-41149","title":"Mermaid: Improper sanitization of `classDef` in state diagrams leads to HTML injection","description":"Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and earlier, as well as 11.0.0-alpha.1 through 11.14.0, are vulnerable to HTML injection under the default configuration. Specifically, the classDef directive in Mermaid state diagrams permits DOM injection that escapes the SVG context. However, <script> tags are stripped, which ","descriptionLong":"Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and earlier, as well as 11.0.0-alpha.1 through 11.14.0, are vulnerable to HTML injection under the default configuration. Specifically, the classDef directive in Mermaid state diagrams permits DOM injection that escapes the SVG context. However, <script> tags are stripped, which prevents cross-site scripting (XSS). This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting \"securityLevel\": \"sandbox\", which prevents the issue by rendering the mermaid diagram in a sandboxed <iframe>.","published":"2026-05-22T22:34:36.944Z","updated":"2026-10-28T02:30:49.509162608Z","reserved":"2026-04-17T12:59:15.739Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L","rating":"medium","source":"GitHub_M"},{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"medium","source":"github.com"},{"version":"4.0","score":null,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L","rating":"medium","source":"GitHub"}],"rating":"medium","products":["mermaid-js mermaid"],"affectedProducts":[{"vendor":"mermaid-js","product":"mermaid","defaultStatus":null,"versions":[{"version":">= 11.0.0-alpha.1, < 11.15.0","status":"affected"},{"version":"< 10.9.6","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"mermaid","purl":"pkg:npm/mermaid","ranges":[">=11.0.0-alpha.1 <11.15.0","<10.9.6"],"fixed":["11.15.0","10.9.6"],"advisory":"GHSA-ghcm-xqfw-q4vr"}],"cwes":["CWE-94"],"aliases":["GHSA-ghcm-xqfw-q4vr"],"references":[{"url":"https://github.com/mermaid-js/mermaid/security/advisories/GHSA-ghcm-xqfw-q4vr","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/mermaid-js/mermaid/commit/37ff937f1da2e19f882fd1db01235db4d01f4056","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/mermaid-js/mermaid/commit/4e2d512bf5bf6f9de1a8f0a48da78dc4d09ac4f3","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41149.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41149","tags":["advisory"]},{"url":"https://github.com/mermaid-js/mermaid","tags":["package"]},{"url":"https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.15.0","tags":["web"]},{"url":"https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6","tags":["web"]},{"url":"https://mermaid.js.org/config/schema-docs/config.html#securitylevel","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00401,"epssPercentile":0.35051,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-41149","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41149","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-41149","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-ghcm-xqfw-q4vr","ok":true,"note":"GHSA-ghcm-xqfw-q4vr"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-41149","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}