CVE-2026-26226: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in lukilabs beautiful-mermaid
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 Analysis
Technical Summary
The vulnerability in beautiful-mermaid arises from improper neutralization of input during web page generation. Specifically, user-controlled values from Mermaid style and classDef directives are interpolated directly into SVG attribute values without proper escaping. This allows crafted input to break out of the attribute context and inject arbitrary SVG elements or attributes into the rendered SVG output. When this SVG is embedded in a web page, it can lead to script execution in the context of the embedding origin, constituting a cross-site scripting (XSS) vulnerability. The issue affects versions prior to 0.1.3.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary scripts in the context of the embedding web page's origin. This can lead to theft of sensitive information, session hijacking, or other malicious actions permitted by script execution in the victim's browser. The vulnerability is limited to scenarios where attacker-controlled Mermaid diagrams are rendered and embedded in web pages.
Mitigation Recommendations
No official patch or fix is currently available for this vulnerability. Users should avoid rendering untrusted Mermaid diagrams with affected versions of beautiful-mermaid. Monitor the vendor's advisory channels for updates or patches addressing this issue. Applying input sanitization or escaping on Mermaid style and classDef directives before rendering may reduce risk but is not a guaranteed fix.
CVE-2026-26226: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in lukilabs 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.
CVSS v4.0
Score 5.3medium
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in beautiful-mermaid arises from improper neutralization of input during web page generation. Specifically, user-controlled values from Mermaid style and classDef directives are interpolated directly into SVG attribute values without proper escaping. This allows crafted input to break out of the attribute context and inject arbitrary SVG elements or attributes into the rendered SVG output. When this SVG is embedded in a web page, it can lead to script execution in the context of the embedding origin, constituting a cross-site scripting (XSS) vulnerability. The issue affects versions prior to 0.1.3.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary scripts in the context of the embedding web page's origin. This can lead to theft of sensitive information, session hijacking, or other malicious actions permitted by script execution in the victim's browser. The vulnerability is limited to scenarios where attacker-controlled Mermaid diagrams are rendered and embedded in web pages.
Mitigation Recommendations
No official patch or fix is currently available for this vulnerability. Users should avoid rendering untrusted Mermaid diagrams with affected versions of beautiful-mermaid. Monitor the vendor's advisory channels for updates or patches addressing this issue. Applying input sanitization or escaping on Mermaid style and classDef directives before rendering may reduce risk but is not a guaranteed fix.
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: 02/13/2026, 16:49:13 UTC
Last enriched: 07/15/2026, 11:09:14 UTC
Last updated: 09/10/2026, 19:36:53 UTC
Views: 229
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.