Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-26226: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in lukilabs beautiful-mermaid

0
Medium
VulnerabilityCVE-2026-26226cvecve-2026-26226cwe-79
Published: Fri Feb 13 2026 (02/13/2026, 16:35:06 UTC)
Source: CVE Database V5
Vendor/Project: lukilabs
Product: beautiful-mermaid

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.

AI-Powered Analysis

AILast updated: 02/13/2026, 17:04:15 UTC

Technical Analysis

CVE-2026-26226 is an XSS vulnerability classified under CWE-79 affecting the beautiful-mermaid library developed by lukilabs. The vulnerability exists in versions prior to 0.1.3 due to improper sanitization of user-controlled input within Mermaid diagram style and classDef directives. These inputs are interpolated directly into SVG attribute values without adequate escaping, allowing attackers to inject malicious SVG elements or attributes. This SVG attribute injection can break out of the intended attribute context, enabling execution of arbitrary scripts when the SVG is embedded in a web page. The attack vector is network-based with low attack complexity, requiring no privileges but some user interaction to trigger the malicious SVG rendering. The vulnerability impacts confidentiality and integrity by enabling script execution in the context of the embedding origin, potentially leading to session hijacking, data theft, or unauthorized actions. The CVSS 4.0 vector (AV:N/AC:L/AT:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N) indicates a medium severity with limited scope and impact. No public exploits have been reported yet, but the vulnerability poses a risk especially in environments where user-generated Mermaid diagrams are rendered dynamically in web applications. The issue highlights the importance of proper input validation and escaping in SVG generation contexts.

Potential Impact

For European organizations, the vulnerability presents a moderate risk primarily to web applications that incorporate the beautiful-mermaid library for rendering Mermaid diagrams. Successful exploitation can lead to cross-site scripting attacks, enabling attackers to execute arbitrary JavaScript in users' browsers. This can result in session hijacking, credential theft, unauthorized actions, or distribution of malware. Organizations handling sensitive or regulated data (e.g., financial, healthcare, government sectors) may face compliance and reputational risks if exploited. The vulnerability could also be leveraged in targeted phishing campaigns or supply chain attacks where malicious Mermaid diagrams are embedded in trusted web portals or documentation. Although no known exploits exist currently, the ease of exploitation and common use of Mermaid diagrams in documentation and dashboards make this a relevant threat. The impact on availability is limited, but confidentiality and integrity risks are notable. European entities relying on dynamic web content generation with this library should consider this vulnerability a priority for remediation to prevent potential compromise.

Mitigation Recommendations

1. Upgrade beautiful-mermaid to version 0.1.3 or later where the vulnerability is patched. 2. Implement strict input validation and sanitization on all user-supplied Mermaid diagram inputs, especially style and classDef directives, to ensure no malicious SVG attributes can be injected. 3. Employ Content Security Policy (CSP) headers to restrict script execution and reduce the impact of potential XSS attacks. 4. Avoid embedding user-generated SVG content directly into web pages without sanitization or sandboxing. 5. Use security-focused libraries or tools to sanitize SVG content before rendering. 6. Monitor web application logs and user reports for suspicious activity related to Mermaid diagram rendering. 7. Educate developers and content creators about secure handling of dynamic SVG content and the risks of XSS in SVG contexts. 8. Conduct regular security assessments and code reviews focusing on input handling in web rendering components.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
VulnCheck
Date Reserved
2026-02-11T20:08:07.945Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 698f5609c9e1ff5ad84b62ac

Added to database: 2/13/2026, 4:49:13 PM

Last enriched: 2/13/2026, 5:04:15 PM

Last updated: 2/13/2026, 7:21:05 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats