{"id":"CVE-2026-50159","published":"2026-08-06T19:55:27Z","modified":"2026-08-07T17:18:23Z","title":"Mermaid allows CSS injection applying to sibling elements of the diagram","vendor":"mermaid-js","product":"mermaid","tier":"tail","description":{"text":"Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.8 and 11.16.1, Mermaid is vulnerable to CSS injection via sibling combinator selectors generated from diagram-supplied class or id names. An attacker who can supply diagram text can inject arbitrary CSS into the rendered page, potentially altering the appearance or behavior of unrelated page elements. This issue is fixed in versions 10.9.8 and 11.16.1.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00603,"percentile":0.4979,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/mermaid-js/mermaid/security/advisories/GHSA-6x64-9x62-f2gx","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/mermaid-js/mermaid/pull/8022","tags":["x_refsource_MISC"]},{"url":"https://github.com/mermaid-js/mermaid/commit/12d472c9ed43f94814b110da8d7a9ae6dd5266ed","tags":["x_refsource_MISC"]},{"url":"https://github.com/mermaid-js/mermaid/commit/7e83f1533318b307764d961906a73377266f4c5e","tags":["x_refsource_MISC"]},{"url":"https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.16.1","tags":["x_refsource_MISC"]},{"url":"https://github.com/mermaid-js/mermaid/releases/tag/v10.9.8","tags":["x_refsource_MISC"]}],"priority":{"score":13.7,"factors":[{"name":"EPSS percentile","points":9.96},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"mermaid-js","affectedVersions":[{"vendor":"mermaid-js","product":"mermaid","versions":["< 10.9.8",">= 11.0.0-alpha.1, < 11.16.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-08-07T17:18:05.573812Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"mermaid","vulnerableRanges":[">=11.0.0-alpha.1, <11.16.1","<10.9.8"],"patched":["11.16.1","10.9.8"],"from":["GHSA-6x64-9x62-f2gx"],"provenance":"source"}],"summary":{"text":"Mermaid, the JavaScript diagramming library from mermaid-js, has a CSS injection flaw in versions before 10.9.8 and 11.16.1, where class or id names taken from diagram text are turned into sibling combinator selectors. An attacker who can supply diagram text can inject arbitrary CSS that alters the appearance or behaviour of unrelated page elements, and exploitation requires a user to interact with the page (UI:P).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:44:31Z"},"euvd":{"id":"EUVD-2026-54243","exploited":false,"provenance":"source"}}