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
    • 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-51757

CVE-2024-51757: happy-dom RCE Vulnerability

CVE-2024-51757 is a remote code execution flaw in happy-dom that allows attackers to execute arbitrary code on the host via script tags. This article covers technical details, affected versions, impact, and mitigation.

Published: April 1, 2026

CVE-2024-51757 Overview

CVE-2024-51757 is a critical remote code execution vulnerability in happy-dom, a JavaScript implementation of a web browser without its graphical user interface. This library is commonly used for server-side rendering, testing, and web scraping in Node.js environments. Versions prior to 15.10.2 are susceptible to arbitrary code execution on the host system through malicious script tags embedded in parsed HTML content.

Critical Impact

Attackers can execute arbitrary code on servers running vulnerable versions of happy-dom by injecting malicious script tags, potentially leading to complete system compromise.

Affected Products

  • happy-dom versions prior to 15.10.2
  • Node.js applications using vulnerable happy-dom versions for server-side rendering
  • Testing frameworks utilizing happy-dom for DOM simulation

Discovery Timeline

  • 2024-11-06 - CVE-2024-51757 published to NVD
  • 2024-11-08 - Last updated in NVD database

Technical Details for CVE-2024-51757

Vulnerability Analysis

This vulnerability exists in the happy-dom library's handling of script tags during HTML parsing and execution. Unlike a traditional browser environment where JavaScript execution is sandboxed, happy-dom runs in the Node.js environment with full access to the host system's resources. When processing untrusted HTML content containing script tags, the library fails to properly sanitize or isolate the script execution context, allowing malicious code to break out of the intended DOM simulation and execute with the privileges of the Node.js process.

The vulnerability is classified as CWE-79 (Cross-Site Scripting), though in this server-side context it manifests as a code injection vector rather than traditional client-side XSS. The network attack vector with no authentication requirements makes this particularly dangerous for applications that process user-supplied HTML content.

Root Cause

The root cause lies in improper input handling within the SyncFetchScriptBuilder.ts module. Specifically, the vulnerability stems from the unsafe construction of JavaScript code using template literals without proper escaping. User-controlled URL data was being directly interpolated into executable code strings, allowing injection of arbitrary JavaScript that would execute in the Node.js context.

Attack Vector

The attack vector involves supplying malicious HTML content containing script tags to an application using a vulnerable version of happy-dom. When the library parses and processes this content, the malicious script executes within the Node.js environment, potentially allowing attackers to:

  1. Read sensitive files from the server file system
  2. Execute system commands
  3. Establish reverse shells for persistent access
  4. Exfiltrate environment variables and secrets
  5. Pivot to other internal systems

The security patch demonstrates the fix by properly encoding the URL using JSON.stringify() instead of direct template literal interpolation:

typescript
// Security patch in packages/happy-dom/src/fetch/utilities/SyncFetchScriptBuilder.ts
                const request = sendRequest(${JSON.stringify(
                    request.url.href
                )}, options, (incomingMessage) => {
                    let data = Buffer.alloc(0);
                    incomingMessage.on('data', (chunk) => {
                        data = Buffer.concat([data, Buffer.from(chunk)]);

Source: GitHub Commit Bug Fix

Detection Methods for CVE-2024-51757

Indicators of Compromise

  • Unexpected child processes spawned by Node.js applications using happy-dom
  • Unusual network connections originating from server-side rendering processes
  • Anomalous file system access patterns from Node.js processes
  • Suspicious script tags in application logs containing Node.js-specific APIs (e.g., require, process, child_process)

Detection Strategies

  • Audit package.json and package-lock.json files for happy-dom versions below 15.10.2
  • Implement runtime monitoring for unexpected module loading (e.g., child_process, fs, net) during HTML parsing
  • Use Software Composition Analysis (SCA) tools to identify vulnerable dependencies across your codebase
  • Monitor for process execution anomalies in server-side rendering services

Monitoring Recommendations

  • Enable verbose logging for applications processing untrusted HTML content
  • Implement egress filtering to detect unauthorized outbound connections from rendering services
  • Set up alerts for any file system modifications by happy-dom-utilizing processes
  • Configure application-level sandboxing using Node.js --experimental-permission flags where possible

How to Mitigate CVE-2024-51757

Immediate Actions Required

  • Upgrade happy-dom to version 15.10.2 or later immediately
  • Audit all applications using happy-dom for exposure to untrusted HTML input
  • Review logs for any indicators of exploitation attempts
  • Consider temporarily disabling features that process untrusted HTML until patching is complete

Patch Information

The vulnerability has been fixed in happy-dom version 15.10.2. The fix properly sanitizes URL inputs using JSON.stringify() to prevent code injection through template literal interpolation. Security patches are available through the following commits:

  • GitHub Commit Update
  • GitHub Commit Bug Fix

For complete details, refer to the GitHub Security Advisory GHSA-96g7-g7g9-jxw8.

Workarounds

  • There are no known workarounds for this vulnerability - upgrading is required
  • As a temporary measure, avoid processing untrusted HTML content with happy-dom until the patch is applied
  • Consider using alternative DOM implementations with proper sandboxing if immediate upgrade is not possible
bash
# Upgrade happy-dom to patched version
npm update happy-dom@15.10.2

# Or specify exact version in package.json
npm install happy-dom@^15.10.2 --save

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechHappy Dom

  • SeverityCRITICAL

  • CVSS Score9.3

  • EPSS Probability0.66%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/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
  • AvailabilityHigh
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Bug Fix

  • GitHub Issue Discussion

  • GitHub Pull Request

  • GitHub Release Version 15.10.2

  • GitHub Security Advisory GHSA-96g7-g7g9-jxw8
  • Related CVEs
  • CVE-2026-33943: Happy DOM RCE Vulnerability

  • CVE-2025-62410: happy-dom RCE 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