CVE-2026-40322: Mermaid Svg Innerhtml Xss Without Dompurify

Mermaid SVG output from `$MERMAID.render()` is inserted into `innerHTML` without DOMPurify sanitization. Mermaid diagrams rendered with securityLevel "loose" allow attacker-controlled HTML/JavaScript to survive into the SVG output (via inline event handlers such as onerror/onload, <script> elements, or javascript: URLs in href attributes). The regex-only app

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-40322-mermaid-svg-innerhtml-xss-without-dompurify --engine opengrep

Description

Mermaid SVG output from `$MERMAID.render()` is inserted into `innerHTML` without DOMPurify sanitization. Mermaid diagrams rendered with securityLevel "loose" allow attacker-controlled HTML/JavaScript to survive into the SVG output (via inline event handlers such as onerror/onload, <script> elements, or javascript: URLs in href attributes). The regex-only app