beautiful-mermaid versions prior to 0.1.3 contain an SVG attribute injection issue that can lead to cross-site scripting (XSS) when rendering attacker-controlled Mermaid diagrams. User-controlled values from Mermaid style and classDef directives are interpolated into SVG attribute values without proper escaping, allowing crafted input to break out of an attribute context and inject arbitrary SVG elements/attributes into the rendered output. When the generated SVG is embedded in a web page, this can result in script execution in the context of the embedding origin.
Security readout for executives and security teams
Plain-English summary
CVE-2026-26226 is an XSS issue in beautiful-mermaid before 0.1.3. If a site renders Mermaid diagrams supplied by users, crafted styling directives may inject unsafe SVG content. The impact is tied to the web page that embeds the generated SVG.
Executive priority
Address in the normal web application patch cycle, faster for products accepting customer-authored diagrams or publishing generated SVG into authenticated pages.
Technical view
The flaw is SVG attribute injection from Mermaid style and classDef values interpolated without proper escaping. Crafted input can break SVG attribute context and inject elements or attributes, leading to script execution in the embedding origin. It is classified as CWE-79 with CVSS 4.0 score 5.3.
Likely exposure
Exposure is most likely in applications using beautiful-mermaid before 0.1.3 to render attacker-controlled or multi-tenant Mermaid diagrams into web pages.
Exploitation context
The bundle includes a technical/exploit-tagged reference, but KEV is false and no cited source states active exploitation in the wild.
Researcher notes
The affected range is described as versions prior to 0.1.3, though the provided affected metadata is sparse. Focus validation on style and classDef rendering paths and trust boundaries around SVG embedding.
Mitigation direction
Upgrade beautiful-mermaid to version 0.1.3 or later.
Prioritize systems rendering user-supplied Mermaid diagrams.
Review vendor release notes and PR #8 for patch context.
Temporarily avoid embedding untrusted generated SVG where upgrade is delayed.
Validation and detection
Inventory applications and dependencies for beautiful-mermaid usage.
Confirm installed beautiful-mermaid versions are 0.1.3 or later.
Identify routes that render Mermaid input from users or tenants.
Verify generated SVG is not embedded from untrusted diagram input on outdated versions.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-79: User-session and phishing behavior lookup
Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-79 · source CWE mapping
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.