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-2024-47068

CVE-2024-47068: Rollupjs Rollup XSS Vulnerability

CVE-2024-47068 is a DOM Clobbering XSS vulnerability in Rollupjs Rollup affecting scripts bundled with import.meta properties. This post explains its technical details, affected versions, and mitigation steps.

Updated: January 22, 2026

CVE-2024-47068 Overview

CVE-2024-47068 is a DOM Clobbering vulnerability affecting Rollup, a popular JavaScript module bundler. The vulnerability exists in how Rollup handles scripts utilizing properties from import.meta (such as import.meta.url) when bundling in cjs, umd, or iife output formats. This flaw can be exploited as a gadget to achieve cross-site scripting (XSS) attacks on web pages where attacker-controlled HTML elements are present without proper sanitization.

Critical Impact

This DOM Clobbering vulnerability enables attackers to execute arbitrary JavaScript in victim browsers through XSS when unsanitized HTML elements (e.g., an img tag with a malicious name attribute) exist on the target page.

Affected Products

  • Rollup versions prior to 2.79.2
  • Rollup versions 3.x prior to 3.29.5
  • Rollup versions 4.x prior to 4.22.4

Discovery Timeline

  • September 23, 2024 - CVE-2024-47068 published to NVD
  • October 29, 2024 - Last updated in NVD database

Technical Details for CVE-2024-47068

Vulnerability Analysis

The vulnerability resides in the MetaProperty.ts file within Rollup's AST node processing logic. When Rollup bundles JavaScript modules that reference import.meta properties and outputs them in CommonJS (cjs), Universal Module Definition (umd), or Immediately Invoked Function Expression (iife) formats, it generates code that references document.currentScript.src to resolve the script's URL.

The original implementation lacked proper validation to ensure that document.currentScript actually referred to a legitimate <script> element. This oversight creates a DOM Clobbering vulnerability where an attacker can inject HTML elements with specific name or id attributes that override the expected DOM property references, effectively hijacking the script resolution mechanism to inject malicious content.

Root Cause

The root cause is insufficient validation of DOM element types when accessing document.currentScript. The vulnerable code blindly trusted that document.currentScript would return a <script> element without verifying its tagName property. In browsers, DOM Clobbering allows named HTML elements to be accessed as properties of document, enabling attackers to substitute expected DOM references with malicious elements.

Attack Vector

The attack requires the following conditions:

  1. A web application uses Rollup-bundled JavaScript in cjs, umd, or iife format
  2. The bundled code accesses import.meta properties (e.g., import.meta.url)
  3. The page contains attacker-controlled HTML elements without proper sanitization (e.g., through user-generated content)

An attacker can inject an HTML element such as <img name="currentScript" src="javascript:alert('XSS')"> which overrides document.currentScript, causing the bundled code to use the attacker's malicious element instead of the legitimate script reference, leading to XSS execution.

typescript
// Vulnerable code before patch (from MetaProperty.ts)
// The code accessed document.currentScript.src without type validation
getResolveUrl(
    `'${escapeId(relativePath)}', ${
        umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.src || document.baseURI`
);

// Patched code adds tagName validation to prevent DOM Clobbering
getResolveUrl(
    `'${escapeId(relativePath)}', ${
        umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
);

Source: GitHub Commit - Fix DOM Clobbering CVE

Detection Methods for CVE-2024-47068

Indicators of Compromise

  • Presence of suspicious HTML elements with name or id attributes matching DOM global properties (e.g., name="currentScript")
  • Unexpected XSS payload execution originating from Rollup-bundled script contexts
  • Anomalous DOM manipulation activity in browser developer console logs

Detection Strategies

  • Audit Rollup version in package.json and package-lock.json files to identify vulnerable versions (<2.79.2, <3.29.5 for 3.x, or <4.22.4 for 4.x)
  • Implement Content Security Policy (CSP) headers with strict script-src directives to detect and block unauthorized script execution
  • Monitor for DOM Clobbering patterns in user-submitted HTML content through input validation logging
  • Use static analysis tools to scan bundled JavaScript for vulnerable import.meta usage patterns in cjs/umd/iife outputs

Monitoring Recommendations

  • Enable browser-based XSS auditing and CSP violation reporting to capture exploitation attempts
  • Monitor dependency update notifications from npm audit or Snyk for Rollup package vulnerabilities
  • Implement runtime integrity checks for critical DOM properties in production applications

How to Mitigate CVE-2024-47068

Immediate Actions Required

  • Upgrade Rollup to patched versions: 2.79.2, 3.29.5, or 4.22.4 depending on your major version branch
  • Audit existing applications for user-generated content that may contain unsanitized HTML elements
  • Implement strict HTML sanitization for all user input to prevent DOM Clobbering attack vectors
  • Review CSP headers to ensure restrictive script-src policies are in place

Patch Information

The Rollup maintainers have released security patches in versions 2.79.2, 3.29.5, and 4.22.4. The fix adds explicit validation of document.currentScript.tagName to ensure it equals 'SCRIPT' before accessing the src property. Detailed patch information is available in the GitHub Security Advisory.

Workarounds

  • If immediate upgrade is not possible, switch bundled output format to es modules which don't rely on document.currentScript
  • Implement server-side HTML sanitization to strip potentially dangerous name and id attributes from user content
  • Deploy Content Security Policy headers with script-src 'self' to limit XSS impact
  • Use DOMPurify or similar libraries to sanitize any HTML rendered in the application context
bash
# Update Rollup to patched version
npm update rollup@latest

# Or specify exact patched versions based on your major version
npm install rollup@2.79.2  # For 2.x users
npm install rollup@3.29.5  # For 3.x users  
npm install rollup@4.22.4  # For 4.x users

# Verify installed version
npm list rollup

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechRollup

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability2.11%

  • 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-79
  • Technical References
  • GitHub Code Snippet

  • GitHub Code Snippet
  • Vendor Resources
  • GitHub Commit Log

  • GitHub Commit Log

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-27606: Rollup.js Path Traversal Vulnerability
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