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-2026-33943

CVE-2026-33943: Happy DOM RCE Vulnerability

CVE-2026-33943 is a remote code execution flaw in Happy DOM's ECMAScriptModuleCompiler that allows attackers to inject arbitrary JavaScript. This article covers technical details, affected versions, and patches.

Published: April 2, 2026

CVE-2026-33943 Overview

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface, commonly used in testing environments. A code injection vulnerability exists in the ECMAScriptModuleCompiler component in versions 15.10.0 through 20.8.7 that allows an attacker to achieve Remote Code Execution (RCE) by injecting arbitrary JavaScript expressions inside export { } declarations in ES module scripts processed by Happy DOM.

The vulnerability stems from the compiler directly interpolating unsanitized content into generated code as an executable expression. Additionally, the quote filter does not strip backticks, allowing template literal-based payloads to bypass sanitization mechanisms.

Critical Impact

Attackers can achieve Remote Code Execution by injecting malicious JavaScript expressions through ES module export declarations, potentially compromising server-side applications using Happy DOM for testing or rendering.

Affected Products

  • Happy DOM versions 15.10.0 through 20.8.7
  • Applications using Happy DOM for server-side DOM simulation
  • Testing frameworks integrating vulnerable Happy DOM versions

Discovery Timeline

  • 2026-03-27 - CVE CVE-2026-33943 published to NVD
  • 2026-03-30 - Last updated in NVD database

Technical Details for CVE-2026-33943

Vulnerability Analysis

This vulnerability is classified as CWE-94 (Improper Control of Generation of Code - Code Injection). The ECMAScriptModuleCompiler in Happy DOM processes ES module scripts and dynamically generates executable code. When handling export { } declarations, the compiler fails to properly sanitize the content being interpolated into the generated code.

The core issue lies in the fact that export names are interpolated directly as executable expressions without adequate input validation. While some filtering exists for quotes, the sanitization mechanism does not account for backtick characters, which can be used to construct template literals in JavaScript. This oversight allows attackers to craft payloads that escape the intended context and execute arbitrary code.

Root Cause

The root cause is insufficient input validation in the ECMAScriptModuleCompiler component. Export names from ES module scripts are processed and interpolated into generated code without ensuring they conform to valid JavaScript identifier patterns. The absence of backtick filtering in the quote sanitization routine enables template literal injection, which attackers can leverage to execute arbitrary JavaScript expressions within the context of the Happy DOM runtime.

Attack Vector

The attack vector is network-based and requires user interaction. An attacker must craft a malicious ES module script containing specially crafted export declarations with injected JavaScript expressions using template literals. When a vulnerable application processes this malicious module through Happy DOM, the injected code executes with the privileges of the application, potentially leading to full server compromise, data exfiltration, or lateral movement within the infrastructure.

The following patch demonstrates the security fix implemented in version 20.8.8:

typescript
  */
 const IMPORT_REGEXP = /{([^}]+)}|\*\s+as\s+([a-zA-Z0-9-_$]+)|([a-zA-Z0-9-_$]+)/gm;
 
+/**
+ * Strip invalid variable name characters regexp.
+ */
+const VALID_VARIABLE_NAME_REGEXP = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
+
 /**
  * Valid preceding token before a statement.
  */

Source: GitHub Commit Update

The fix introduces a VALID_VARIABLE_NAME_REGEXP pattern that validates export names against strict JavaScript identifier rules, ensuring only alphanumeric characters, underscores, and dollar signs are permitted, with proper starting character constraints. This prevents injection of arbitrary expressions including template literals.

Detection Methods for CVE-2026-33943

Indicators of Compromise

  • Unusual JavaScript errors or unexpected code execution in Happy DOM processing logs
  • Presence of template literal syntax (backticks) within ES module export declarations in processed scripts
  • Unexpected outbound network connections from Node.js processes running Happy DOM
  • Anomalous process spawning or file system access from testing or rendering services

Detection Strategies

  • Implement code review processes to identify ES module inputs processed by Happy DOM versions prior to 20.8.8
  • Deploy application-layer monitoring to detect malformed or suspicious export declarations in module scripts
  • Use static analysis tools to scan for direct usage of vulnerable Happy DOM versions in package.json or lock files
  • Enable verbose logging in Happy DOM processing pipelines to capture potential injection attempts

Monitoring Recommendations

  • Monitor application logs for JavaScript runtime errors associated with ECMAScript module compilation
  • Set up alerts for any child process execution originating from Happy DOM processing contexts
  • Track dependency versions across CI/CD pipelines to flag vulnerable Happy DOM installations
  • Implement network egress monitoring for services utilizing Happy DOM for server-side rendering

How to Mitigate CVE-2026-33943

Immediate Actions Required

  • Upgrade Happy DOM to version 20.8.8 or later immediately
  • Audit all applications using Happy DOM versions between 15.10.0 and 20.8.7
  • Review logs for any suspicious activity that may indicate prior exploitation
  • Implement input validation for any user-controlled content processed through ES modules

Patch Information

The vulnerability has been addressed in Happy DOM version 20.8.8. The patch introduces strict validation of export names using a regular expression pattern that ensures only valid JavaScript identifiers are accepted, preventing code injection through template literals or other expression syntax.

Refer to the GitHub Release v20.8.8 for the official patch release. Additional details about the vulnerability and fix can be found in the GitHub Security Advisory GHSA-6q6h-j7hj-3r64.

Workarounds

  • Avoid processing untrusted ES module scripts through Happy DOM until patching is complete
  • Implement pre-processing validation to reject modules containing backticks in export declarations
  • Isolate Happy DOM processing in sandboxed environments with limited privileges
  • Use Content Security Policy or similar controls to restrict code execution scope where applicable
bash
# Upgrade Happy DOM to patched version
npm update happy-dom@20.8.8

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

# Verify installed version
npm list happy-dom

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 Score8.8

  • EPSS Probability0.08%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • GitHub Commit Update

  • GitHub Release v20.8.8

  • GitHub Security Advisory GHSA-6q6h-j7hj-3r64
  • Related CVEs
  • 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 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