The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-26226

CVE-2026-26226: beautiful-mermaid XSS Vulnerability

CVE-2026-26226 is a cross-site scripting flaw in beautiful-mermaid versions before 0.1.3 that enables SVG attribute injection via Mermaid diagrams. This article covers the technical details, affected versions, and mitigation.

Published: February 20, 2026

CVE-2026-26226 Overview

CVE-2026-26226 is an SVG attribute injection vulnerability affecting the beautiful-mermaid npm package versions prior to 0.1.3. This flaw allows attackers to achieve 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, enabling crafted input to break out of an attribute context and inject arbitrary SVG elements and attributes into the rendered output.

Critical Impact

When the generated SVG is embedded in a web page, this vulnerability enables script execution in the context of the embedding origin, potentially allowing session hijacking, credential theft, and malicious actions on behalf of authenticated users.

Affected Products

  • beautiful-mermaid versions prior to 0.1.3

Discovery Timeline

  • February 13, 2026 - CVE-2026-26226 published to NVD
  • February 13, 2026 - Last updated in NVD database

Technical Details for CVE-2026-26226

Vulnerability Analysis

This vulnerability represents a classic input validation failure in the context of SVG rendering. The beautiful-mermaid library processes Mermaid diagram syntax and generates SVG output for display in web applications. When handling user-supplied values within style and classDef directives, the library fails to properly sanitize or escape these inputs before interpolating them into SVG attribute values.

The lack of proper escaping creates an injection point where an attacker can craft malicious input that terminates the current attribute context and introduces arbitrary SVG content. Since SVG supports inline JavaScript through various event handlers and the <script> element, this attribute injection vulnerability escalates directly to cross-site scripting.

Root Cause

The root cause is improper input validation (CWE-79) in the SVG generation process. The library directly interpolates user-controlled values from Mermaid style and classDef directives into SVG attributes without implementing proper output encoding or sanitization. Specifically, special characters such as quotes, angle brackets, and event handler attributes are not escaped, allowing attackers to break out of the intended attribute context.

Attack Vector

This vulnerability is exploitable over the network, requiring user interaction (the victim must view a page containing the malicious Mermaid diagram). An attacker would craft a malicious Mermaid diagram containing specially-crafted style or classDef directives with injection payloads. When a victim views a web page that renders this diagram using a vulnerable version of beautiful-mermaid, the injected SVG content executes arbitrary JavaScript in the victim's browser context.

The attack flow involves embedding malicious attribute values that include quote characters to escape the current attribute, followed by event handlers such as onload or onclick containing JavaScript payloads. When the SVG is rendered in a victim's browser, these event handlers execute, compromising the user's session.

Detection Methods for CVE-2026-26226

Indicators of Compromise

  • Presence of beautiful-mermaid package versions below 0.1.3 in package.json or package-lock.json files
  • SVG output containing unexpected event handler attributes such as onload, onclick, onerror, or onmouseover
  • User-generated Mermaid diagrams containing unusual characters in style or classDef directives, particularly quote characters and angle brackets
  • JavaScript errors or unexpected script execution when rendering Mermaid diagrams

Detection Strategies

  • Implement dependency scanning tools to identify vulnerable versions of beautiful-mermaid in your codebase
  • Deploy web application firewalls (WAF) with rules to detect XSS patterns in requests containing Mermaid diagram syntax
  • Monitor for Content Security Policy (CSP) violations that may indicate attempted XSS exploitation
  • Review application logs for requests containing suspicious patterns in Mermaid diagram inputs

Monitoring Recommendations

  • Enable browser-side CSP reporting to detect inline script execution attempts
  • Implement server-side logging for all user-submitted Mermaid diagram content
  • Monitor npm audit and security advisory feeds for beautiful-mermaid package updates
  • Set up alerts for dependency version mismatches between development and production environments

How to Mitigate CVE-2026-26226

Immediate Actions Required

  • Upgrade beautiful-mermaid to version 0.1.3 or later immediately
  • Audit any user-generated Mermaid diagrams stored in your application for potential exploitation attempts
  • Review rendered SVG output for unexpected attributes or elements
  • Implement Content Security Policy headers to mitigate the impact of any successful XSS attacks

Patch Information

The vulnerability has been addressed in beautiful-mermaid version 0.1.3. The fix implements proper escaping of user-controlled values before interpolation into SVG attributes. Organizations should update to this version or later to remediate the vulnerability.

For detailed patch information, see the GitHub Pull Request and the GitHub Release v0.1.3.

Additional technical details are available in the VulnCheck Advisory on SVG Injection.

Workarounds

  • Sanitize all user input before processing with beautiful-mermaid by removing or encoding special characters in style and classDef directive values
  • Implement a strict Content Security Policy that prevents inline script execution (script-src 'self')
  • Render SVG content in sandboxed iframes with the sandbox attribute to isolate potential XSS execution
  • Disable user-controlled Mermaid diagram rendering until the package can be updated
bash
# Update beautiful-mermaid to the patched version
npm update beautiful-mermaid@0.1.3

# Verify the installed version
npm list beautiful-mermaid

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechBeautiful Mermaid

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Pull Request

  • GitHub Release v0.1.3

  • Project Discovery Share

  • VulnCheck Advisory on SVG Injection
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English