CVE-2026-26226

beautiful-mermaid < 0.1.3 SVG Attribute Injection

Published Feb 13, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

Previous releases of Beautiful‑Mermaid allow a user‑controlled Mermaid diagram to inject arbitrary SVG attributes or elements when the style and classDef directives are rendered, because the library does not escape values interpolated into SVG attribute contexts. This unsanitized injection can break out of an attribute value, resulting in script execution inside the context of any web page that embeds the produced SVG. The weakness corresponds to input validation failure (CWE‑79).

Affected Systems

The vulnerable product is Beautiful‑Mermaid from Lukilabs, versions prior to 0.1.3. No other vendors or product variants are listed as affected.

Risk and Exploitability

The CVSS base score is 5.3, indicating moderate impact. The EPSS score is below one percent, suggesting a low current likelihood of exploitation. The vulnerability is not present in the CISA Known Exploit Vulnerabilities catalog. Exploit requires an attacker to supply a crafted Mermaid diagram that is rendered by an application or user that embeds the resulting SVG, implying that remote exploitation would need a vulnerable host that processes user‑controlled Mermaid content.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Beautiful‑Mermaid to version 0.1.3 or later to remove the SVG attribute injection flaw.
  • If an upgrade is not immediately possible, ensure that all Mermaid diagrams are generated and rendered only from trusted or sanitized sources; do not allow arbitrary user input to reach the rendering engine.
  • Implement a Content Security Policy that restricts inline scripts and disallows execution of scripts within embedded SVGs to mitigate any residual XSS risk.

Generated by OpenCVE AI on April 17, 2026 at 19:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-cgmm-x5ww-q5cr beautiful-mermaid contains an SVG attribute injection issue that can lead to cross-site scripting (XSS)
History
Type Values Removed Values Added
First Time appeared Lukilabs
Lukilabs beautiful-mermaid
Vendors & Products Lukilabs
Lukilabs beautiful-mermaid
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title beautiful-mermaid < 0.1.3 SVG Attribute Injection
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 8, 2026, 2:01 PM
Reserved
Feb 11, 2026, 8:08 PM
Status
Deferred
Published
Feb 13, 2026, 5:16 PM
Modified
Oct 8, 2026, 4:17 PM