{"cve":"CVE-2026-41148","nvd":{"published":"2026-05-22T23:16:53.593","modified":"2026-07-23T11:10:00.120","status":"Deferred","description":"Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and prior, in addition to 11.0.0-alpha.1 through 11.12.0 are vulnerable to CSS injection through improper sanitization. The state diagram (and any other diagram type that routes user-controlled style strings through the createCssStyles parser) captures classDef values using an unrestricted regex that matches everything up to a newline. That value then flows unsanitized through addStyleClass() into createCssStyles() and is assigned to style.innerHTML, so a closing brace (}) in the value terminates the generated CSS selector and turns everything after it into a new CSS rule on the page. This enables page defacement, user tracking via url() callbacks, and DOM attribute exfiltration. 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>.","cvss_v4":{"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","score":5.3},"cvss_v3":null,"cwes":["CWE-94"],"references":["https://github.com/mermaid-js/mermaid/commit/8fead23c59166b7bab6a39eac81acebee2859102","https://github.com/mermaid-js/mermaid/commit/e9b0f34d8d82a6260077764ee45e1d7d90957a0f","https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.15.0","https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6","https://github.com/mermaid-js/mermaid/security/advisories/GHSA-xcj9-5m2h-648r"],"products":[],"source":"nvd","synced_at":"2026-10-19T22:36:28.938604137+00:00"},"epss":{"cve":"CVE-2026-41148","score":0.00338,"percentile":0.27239,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-xcj9-5m2h-648r","url":"https://osv.dev/vulnerability/GHSA-xcj9-5m2h-648r","summary":"Mermaid: Improper sanitization of `classDefs` in diagrams leads to CSS injection","modified":"2026-09-10T03:51:07.282173986Z","packages":[{"ecosystem":"npm","name":"mermaid","purl":"pkg:npm/mermaid","ranges":[">=11.0.0-alpha.1 <11.15.0"],"fixed":["11.15.0"]},{"ecosystem":"npm","name":"mermaid","purl":"pkg:npm/mermaid","ranges":["<10.9.6"],"fixed":["10.9.6"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}