A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection Platforms. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Read More
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-2025-61927

CVE-2025-61927: Happy DOM RCE Vulnerability

CVE-2025-61927 is a remote code execution vulnerability in Happy DOM v19 and lower that allows untrusted code to escape the VM context. This article covers the technical details, affected versions, and mitigation steps.

Published: May 26, 2026

CVE-2025-61927 Overview

CVE-2025-61927 affects Happy DOM, a JavaScript implementation of a web browser without a graphical user interface. Happy DOM versions 19 and lower expose consumers to remote code execution when untrusted JavaScript runs inside the library's VM Context. A Node.js VM Context is not an isolated sandbox, so attacker-controlled code can break out and reach process-level functionality. With CommonJS, attackers can obtain the require() function and import arbitrary modules. The risk is amplified because Happy DOM enables JavaScript evaluation by default, a behavior that may not be obvious to integrators. Version 20.0.0 patches the issue by disabling JavaScript evaluation by default.

Critical Impact

Untrusted JavaScript executed within Happy DOM can escape the VM Context and achieve remote code execution on the host process.

Affected Products

  • Happy DOM versions 19 and lower
  • Node.js applications embedding Happy DOM with default configuration
  • Server-side rendering pipelines that evaluate untrusted client-side JavaScript

Discovery Timeline

  • 2025-10-10 - CVE-2025-61927 published to NVD
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-61927

Vulnerability Analysis

The vulnerability is classified as Code Injection [CWE-94]. Happy DOM relies on Node.js vm module contexts to execute page-level JavaScript during DOM simulation. Node.js documentation explicitly states that vm contexts are not a security boundary. When Happy DOM evaluates untrusted scripts inside this context, the attacker can traverse object prototypes and constructor chains to reach the outer Node.js runtime.

Once outside the VM, the attacker gains access to process-level APIs. In CommonJS environments, the attacker can resolve the require() function and load modules such as child_process to spawn arbitrary commands. In ESM environments, available primitives differ but still permit access to host functionality.

Root Cause

The root cause is twofold. First, Happy DOM uses Node.js VM contexts as if they were security sandboxes, which they are not. Second, the enableJavaScriptEvaluation setting defaulted to true, so any consumer that processed untrusted HTML implicitly opted into script execution without explicit acknowledgement.

Attack Vector

An attacker supplies HTML or JavaScript that Happy DOM parses and evaluates. The script uses constructor traversal to escape the VM and invoke require('child_process').execSync() or equivalent module loads. Exploitation requires the application to feed attacker-controlled content into Happy DOM with evaluation enabled.

typescript
// Patch in packages/@happy-dom/server-renderer/src/ServerRenderer.ts
// Adds --disallow-code-generation-from-strings to worker execArgv
					return;
				}
				const worker = new Worker(new URL('ServerRendererWorker.js', import.meta.url), {
+					execArgv: ['--disallow-code-generation-from-strings'],
					workerData: {
						configuration: configuration
					}

Source: GitHub Commit 819d15b

Detection Methods for CVE-2025-61927

Indicators of Compromise

  • Unexpected child processes spawned by Node.js workers hosting Happy DOM, including sh, bash, cmd.exe, or powershell.exe
  • Outbound network connections initiated by server-side rendering processes to unfamiliar hosts
  • File writes or module loads originating from node_modules/happy-dom worker threads
  • Use of require('child_process'), require('fs'), or require('net') triggered during DOM parsing

Detection Strategies

  • Inventory Node.js services and identify those depending on happy-dom at versions 19 or lower via package-lock.json or npm ls happy-dom
  • Inspect application code for usage of Happy DOM with enableJavaScriptEvaluation: true against untrusted input
  • Monitor process trees for Node.js workers spawning shells or interpreters during HTML rendering operations

Monitoring Recommendations

  • Alert on creation of child processes by Node.js server-rendering workers, which should not occur during normal DOM evaluation
  • Track egress connections from rendering services and baseline expected destinations
  • Forward Node.js process telemetry to a centralized analytics platform for behavioral correlation

How to Mitigate CVE-2025-61927

Immediate Actions Required

  • Upgrade Happy DOM to version 20.0.0 or later, where JavaScript evaluation is disabled by default
  • Audit application code for any explicit enableJavaScriptEvaluation: true settings and remove them unless evaluating fully trusted input
  • Run Happy DOM workers with --disallow-code-generation-from-strings to harden the V8 isolate
  • Treat any HTML or script content from external sources as untrusted and never pass it directly to Happy DOM with evaluation enabled

Patch Information

The fix is delivered in Happy DOM 20.0.0. The commit 819d15ba289495439eda8be360d92a614ce22405 changes the default configuration so enableJavaScriptEvaluation must be explicitly enabled. Workers used by @happy-dom/server-renderer are launched with execArgv: ['--disallow-code-generation-from-strings'] to prevent dynamic code generation from escaping the VM context. See the GitHub Security Advisory GHSA-37j7-fg3j-429f for the full advisory.

Workarounds

  • If upgrading immediately is not possible, set enableJavaScriptEvaluation: false in Happy DOM configuration
  • Isolate rendering workloads in containers with minimal privileges, read-only file systems, and restricted egress
  • Avoid passing attacker-controlled HTML to Happy DOM until the upgrade is complete
bash
# Upgrade Happy DOM to a patched release
npm install happy-dom@^20.0.0

# Launch Node.js workers with code generation disabled
node --disallow-code-generation-from-strings server.js

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

  • SeverityHIGH

  • CVSS Score7.2

  • EPSS Probability0.58%

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

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-33943: Happy DOM RCE Vulnerability

  • CVE-2025-62410: happy-dom RCE Vulnerability

  • CVE-2024-51757: happy-dom RCE 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