Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-0540

CVE-2026-0540: Cure53 DOMPurify XSS Vulnerability

CVE-2026-0540 is a cross-site scripting flaw in Cure53 DOMPurify that allows attackers to bypass attribute sanitization using rawtext elements. This article covers the technical details, affected versions, and mitigation.

Published: March 6, 2026

CVE-2026-0540 Overview

DOMPurify, the popular DOM-only XSS sanitization library developed by Cure53, contains a cross-site scripting (XSS) vulnerability in versions 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8. The vulnerability allows attackers to bypass attribute sanitization by exploiting five missing rawtext elements (noscript, xmp, noembed, noframes, iframe) in the SAFE_FOR_XML regex pattern. When sanitized output is placed inside these unprotected rawtext contexts, malicious payloads can execute JavaScript in the victim's browser.

Critical Impact

Attackers can bypass DOMPurify's attribute sanitization and achieve JavaScript execution by crafting payloads that exploit missing rawtext element handling, such as </noscript><img src=x onerror=alert(1)> in attribute values.

Affected Products

  • Cure53 DOMPurify versions 3.1.3 through 3.3.1
  • Cure53 DOMPurify versions 2.5.3 through 2.5.8
  • Web applications using affected DOMPurify versions for HTML sanitization

Discovery Timeline

  • 2026-03-03 - CVE CVE-2026-0540 published to NVD
  • 2026-03-05 - Last updated in NVD database

Technical Details for CVE-2026-0540

Vulnerability Analysis

This vulnerability represents a bypass of DOMPurify's XSS sanitization mechanisms, specifically affecting the SAFE_FOR_XML mode. The library is designed to sanitize HTML and prevent XSS attacks by stripping or neutralizing potentially malicious content. However, the regex pattern used to detect dangerous content within attribute values failed to account for five specific rawtext elements: noscript, xmp, noembed, noframes, and iframe.

When DOMPurify processes HTML content with the SAFE_FOR_XML option enabled, it applies regex-based filtering to attribute values to detect closing tags that could break out of element contexts. The incomplete regex allowed attackers to craft payloads containing closing tags for these unhandled rawtext elements, effectively bypassing the sanitization and enabling script execution.

The vulnerability is particularly concerning because DOMPurify is widely deployed as a security control across numerous web applications and frameworks. Applications that render DOMPurify-sanitized content within rawtext elements (such as <noscript> blocks) are directly vulnerable to XSS exploitation.

Root Cause

The root cause lies in an incomplete regex pattern within DOMPurify's attribute sanitization logic. The SAFE_FOR_XML regex was originally designed to detect and block closing tags like </style> and </title> within attribute values, which could otherwise be used to break out of those contexts. However, the regex did not include coverage for additional rawtext elements (noscript, xmp, noembed, noframes, iframe, textarea), creating a gap that attackers could exploit.

The original regex pattern /((--!?|])>)|<\/(style|title)/i only matched style and title closing tags, leaving the other rawtext elements completely unprotected against this class of context-escaping attacks.

Attack Vector

The attack requires network access and involves crafting malicious HTML input that exploits the regex gap. An attacker can inject a payload containing a closing rawtext tag followed by executable JavaScript. For example, if an application uses DOMPurify to sanitize user input and then renders the output inside a <noscript> element, the attacker can use a payload like:

html
</noscript><img src=x onerror=alert(1)>

When this payload passes through the incomplete sanitization and is rendered within a <noscript> context, the closing tag breaks out of the rawtext element, allowing the subsequent <img> tag's onerror handler to execute JavaScript.

The following patch demonstrates how Cure53 addressed this vulnerability by extending the regex to include the textarea element:

javascript
         value = SANITIZE_NAMED_PROPS_PREFIX + value;
       }
       /* Work around a security issue with comments inside attributes */
-      if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
+      if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
         _removeAttribute(name, currentNode);
         continue;
       }

Source: GitHub DOMPurify Commit

Detection Methods for CVE-2026-0540

Indicators of Compromise

  • HTTP requests containing rawtext element closing tags (</noscript>, </xmp>, </noembed>, </noframes>, </iframe>) in input parameters
  • Web application logs showing unusual attribute values with embedded HTML closing tags
  • JavaScript errors or unexpected script execution originating from DOMPurify-sanitized content areas
  • User reports of unexpected pop-ups or script behavior on pages rendering sanitized HTML

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block payloads containing rawtext closing tags followed by script elements
  • Monitor client-side JavaScript errors that indicate XSS payload execution attempts
  • Use Content Security Policy (CSP) violation reports to identify attempted inline script execution
  • Perform regular dependency scanning to identify applications using vulnerable DOMPurify versions

Monitoring Recommendations

  • Enable detailed logging for all user input processing through DOMPurify sanitization
  • Set up alerts for CSP violations indicating inline-script or eval attempts
  • Monitor npm/yarn audit outputs for known vulnerabilities in dompurify package
  • Implement real-time tracking of JavaScript runtime errors that may indicate XSS exploitation attempts

How to Mitigate CVE-2026-0540

Immediate Actions Required

  • Update DOMPurify to version 3.3.2 or later (for 3.x branch) or the latest patched 2.x version
  • Audit application code to identify where DOMPurify-sanitized output is rendered within rawtext elements
  • Review and strengthen Content Security Policy headers to block inline script execution as a defense-in-depth measure
  • Consider temporarily disabling SAFE_FOR_XML mode if immediate patching is not possible and XML safety is not required

Patch Information

Cure53 has released a security fix in commit fca0a938b4261ddc9c0293a289935a9029c049f5 that improves the regex patterns for rawtext tag handling. The patch extends the SAFE_FOR_XML regex to include additional dangerous closing tags that could be used for context escaping. Organizations using DOMPurify should update to the latest patched version immediately. For detailed patch information, refer to the GitHub DOMPurify Commit Changes.

Workarounds

  • Avoid rendering DOMPurify-sanitized content inside rawtext elements (noscript, xmp, noembed, noframes, iframe) until patched
  • Implement additional server-side validation to strip rawtext closing tags from user input before DOMPurify processing
  • Deploy strict Content Security Policy headers with script-src directives that block inline scripts and unsafe-eval
  • Use HTML encoding as an additional layer when outputting sanitized content within rawtext contexts
bash
# Update DOMPurify via npm
npm update dompurify@latest

# Verify installed version
npm list dompurify

# Audit for vulnerabilities
npm audit

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechDompurify

  • SeverityMEDIUM

  • CVSS Score5.1

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/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
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub DOMPurify Repository

  • VulnCheck DOMPurify XSS Advisory
  • Vendor Resources
  • GitHub DOMPurify Commit Changes
  • Related CVEs
  • CVE-2026-41240: DOMPurify XSS Vulnerability

  • CVE-2026-41238: DOMPurify Prototype Pollution XSS Vulnerability

  • CVE-2026-41239: DOMPurify XSS Vulnerability

  • CVE-2024-48910: Cure53 DOMPurify XSS 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