A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-2024-45801

CVE-2024-45801: DOMPurify XSS Bypass Vulnerability

CVE-2024-45801 is an XSS bypass flaw in DOMPurify that allows attackers to circumvent sanitization using nested HTML and prototype pollution. This article covers the technical details, affected versions, and mitigation.

Updated: May 15, 2026

CVE-2024-45801 Overview

CVE-2024-45801 is a sanitizer bypass in DOMPurify, a widely deployed client-side library used to neutralize cross-site scripting (XSS) payloads in HTML, MathML, and SVG. Specially crafted HTML using nesting techniques can evade the depth-checking logic introduced in earlier hardening releases. Attackers can also leverage prototype pollution to weaken the depth check, defeating the library's XSS protections. The maintainer cure53 has fixed the issue in DOMPurify versions 2.5.4 and 3.1.3. The advisory tracks the issue under GHSA-mmhx-hmjr-r674 and references CWE-1333 and CWE-1321.

Critical Impact

Applications relying on DOMPurify to render untrusted HTML can execute attacker-controlled scripts in the victim's browser, enabling session theft, account takeover, and arbitrary action in the application context.

Affected Products

  • cure53/DOMPurify versions prior to 2.5.4 (2.x branch)
  • cure53/DOMPurify versions prior to 3.1.3 (3.x branch)
  • Web applications and frameworks bundling vulnerable DOMPurify builds (purify.cjs.js, purify.es.mjs)

Discovery Timeline

  • 2024-09-16 - CVE-2024-45801 published to the National Vulnerability Database
  • 2025-09-22 - Last updated in NVD database

Technical Details for CVE-2024-45801

Vulnerability Analysis

DOMPurify parses untrusted HTML into a DOM tree and walks the nodes to strip dangerous elements and attributes. Prior releases added a depth tracker to prevent recursion-based bypasses where deeply nested elements caused the sanitizer to miss malicious content during traversal. CVE-2024-45801 reports two independent weaknesses in that mitigation.

First, specially crafted nesting structures evade the depth counter entirely, allowing payloads to survive sanitization and reach the live DOM. Second, the depth tracking variable is reachable through prototype pollution. By polluting Object.prototype with a property such as the counter key, attackers can force the comparison logic to read attacker-controlled or NaN values, bypassing the threshold check.

The combined effect is a reliable XSS sink in any context where attacker HTML is passed to DOMPurify.sanitize() and then inserted into the page.

Root Cause

The depth tracking code relied on object property lookups without using a hardened own-property check, and did not guard against non-numeric values returned from a polluted prototype chain. The fix adds numberIsNaN = unapply(Number.isNaN) and uses objectHasOwnProperty to validate the depth value before comparison, ensuring polluted prototypes cannot influence sanitization logic. This is consistent with CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes) and CWE-1333 weaknesses.

Attack Vector

Exploitation requires the victim to load a page that passes attacker-supplied HTML through a vulnerable DOMPurify build. The attacker delivers a nested payload or a JSON document that triggers prototype pollution earlier in the request flow, then submits HTML that survives sanitization. Because the scope is Changed and user interaction is required, the typical scenario is a stored or reflected payload rendered when a user views attacker content.

javascript
// Patch excerpt: dist/purify.cjs.js and dist/purify.es.mjs (3.x)
// fix: Hardened the depth tracking code against prototype pollution
 const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
 const regExpTest = unapply(RegExp.prototype.test);
 const typeErrorCreate = unconstruct(TypeError);
+const numberIsNaN = unapply(Number.isNaN);

// Source: https://github.com/cure53/DOMPurify/commit/1e520262bf4c66b5efda49e2316d6d1246ca7b21
javascript
// Patch excerpt: 2.x branch (dist/purify.cjs.js, dist/purify.es.js)
// fix: Merged prototype pollution check into 2.x
 var stringTrim = unapply(String.prototype.trim);
 var regExpTest = unapply(RegExp.prototype.test);
 var typeErrorCreate = unconstruct(TypeError);
+var numberIsNaN = unapply(Number.isNaN);
 function unapply(func) {
   return function (thisArg) {
     for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {

// Source: https://github.com/cure53/DOMPurify/commit/26e1d69ca7f769f5c558619d644d90dd8bf26ebc

Detection Methods for CVE-2024-45801

Indicators of Compromise

  • Inbound HTTP request bodies containing deeply nested or repeated tag patterns (for example, repeated <form>, <math>, or <svg> wrappers) submitted to fields that render rich content.
  • JSON request payloads attempting to set keys such as __proto__, constructor, or prototype reaching endpoints that subsequently invoke DOMPurify.sanitize().
  • Outbound browser errors or CSP violation reports referencing inline script execution from user-generated content surfaces.

Detection Strategies

  • Inventory all front-end bundles and Node.js dependencies for dompurify versions below 2.5.4 or 3.1.3 using npm ls dompurify or software composition analysis (SCA) tooling.
  • Enable a strict Content Security Policy (CSP) with script-src allowlists and report-only endpoints to surface sanitizer escapes in production traffic.
  • Add WAF or API gateway rules to flag request payloads containing prototype-pollution keys (__proto__, constructor.prototype) targeting endpoints that store HTML.

Monitoring Recommendations

  • Monitor CSP violation reports for unexpected inline script executions on pages that render user-submitted HTML.
  • Alert on dependency drift in CI/CD when builds resolve to dompurify versions that do not satisfy >=2.5.4 <3.0.0 || >=3.1.3.
  • Capture browser telemetry for DOM mutations that introduce <script>, on* event handlers, or javascript: URLs after sanitization.

How to Mitigate CVE-2024-45801

Immediate Actions Required

  • Upgrade DOMPurify to 2.5.4 for the 2.x branch or 3.1.3 (or later) for the 3.x branch across all front-end and server-side rendering code paths.
  • Rebuild and redeploy any application bundles that statically include DOMPurify, since the patched code must ship to clients to take effect.
  • Audit application code for prototype-pollution sinks (unsafe Object.assign, recursive merge utilities) and patch them, since they remain useful primitives even after the DOMPurify fix.

Patch Information

The fixes are tracked in commits 1e520262 for the 3.x branch and 26e1d69c for the 2.x branch. Both introduce a hardened numberIsNaN check and objectHasOwnProperty validation around the depth tracking logic. Full details are in the GitHub Security Advisory GHSA-mmhx-hmjr-r674.

Workarounds

  • No vendor-supplied workaround exists; upgrading is required.
  • As a compensating control, deploy a strict CSP that disables inline scripts (script-src 'self') on pages that render sanitized user content.
  • Where feasible, render untrusted content as plain text instead of HTML until patched builds are deployed.
bash
# Upgrade to patched DOMPurify versions
npm install dompurify@^3.1.3
# or for 2.x consumers
npm install dompurify@^2.5.4

# Verify resolved version in the dependency tree
npm ls dompurify

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 Score6.1

  • EPSS Probability0.10%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-1333

  • CWE-1321
  • Technical References
  • GitHub Security Advisory
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Commit Update
  • Related CVEs
  • CVE-2026-41240: DOMPurify XSS Vulnerability

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

  • CVE-2026-41239: DOMPurify XSS Vulnerability

  • CVE-2026-0540: Cure53 DOMPurify XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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