Skip to main content

happy-dom CVE-2025-62410

CRITICAL
Improperly Controlled Modification of Object Prototype Attributes (Prototype Pollution) (CWE-1321)
2025-10-15 security-advisories@github.com
9.4
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply untrusted HTML/JS to happy-dom with JS eval enabled
  2. Exploit
    Deploy prototype pollution to hijack process reference
  3. Execution
    Invoke process.binding spawn_sync
  4. Impact
    Execute arbitrary OS commands on host

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires the embedding application to run happy-dom's Browser/ServerRenderer with JavaScript evaluation enabled (settings.enableJavaScriptEvaluation:true, as shown in the PoC) and to process untrusted/attacker-controlled script content. The prior mitigation --disallow-code-generation-from-strings is explicitly insufficient because the untrusted script shares the same V8 Isolate/process as the application, allowing prototype pollution to hijack references like process. Limiting factors: JavaScript evaluation of untrusted input is NOT a default/typical configuration, which substantially narrows exposed deployments; the attacker also depends on the app passing attacker-controlled markup into the DOM. The fix adds --frozen-intrinsics to the worker, so unpatched (>=19.0.0,<20.0.2) versions remain exploitable regardless.

Impact

This is a genuinely severe vulnerability by technical impact - prototype pollution (CWE-1321) that defeats happy-dom's sandboxing and yields arbitrary OS command execution in the host Node.js process - but the real-world risk is moderated by its narrow preconditions. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:P, 9.4 Critical) with full High impact on both the vulnerable system (VC/VI/VA:H) and subsequent systems (SC/SI/SA:H) reflects a sandbox-escape-to-RCE, consistent with the published PoC. However, exploitation is gated on the application explicitly enabling JavaScript evaluation (settings.enableJavaScriptEvaluation:true) AND feeding happy-dom untrusted script - a non-default, specialized deployment. This explains the LOW EPSS score (0.35%, 27th percentile) and the absence from CISA KEV: publicly available exploit code exists, but the signals point to opportunistic/targeted risk against the specific subset of deployments that run untrusted JS, not broad mass exploitation. The one data tension worth flagging: the vendor vector sets PR:L and UI:P, yet the actual attacker (the author of the untrusted script) holds no credentials - the 'privilege' is really an operator-side configuration precondition, so raw CVSS arguably overstates ease relative to how rarely that config is used. Note also this is an incomplete fix for CVE-2025-61927, so environments that only applied the prior --disallow-code-generation-from-strings mitigation remain exposed until upgrading to 20.0.2.

Exploit ScenarioDerived

An application uses happy-dom's Browser or ServerRenderer with JavaScript evaluation enabled to render attacker-influenced HTML (e.g., server-side rendering of user content or processing scraped/untrusted pages). The attacker embeds a prototype-pollution payload that poisons builtins (e.g., Object.prototype.hasOwnProperty) to recover a reference to Node's process object, then invokes process.binding('spawn_sync') to execute arbitrary OS commands. A working proof-of-concept is published in the GHSA-qpm2-6cq5-7pq5 advisory.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 08, 2026

Prototype pollution in happy-dom 19.0.0 through 20.0.1 allows attacker-controlled script to break out of the library's intended JavaScript sandbox and run arbitrary operating-system commands inside the host Node.js process. Exploitation requires the embedding application to enable JavaScript evaluation (settings.enableJavaScriptEvaluation: true) and to feed untrusted markup into a Browser/ServerRenderer instance - a non-default configuration, which is why real-world exposure is narrower than the raw score suggests. A working proof-of-concept payload is published in the vendor advisory (GHSA-qpm2-6cq5-7pq5), so publicly available exploit code exists; there is no CISA KEV listing, and EPSS is low (0.35%, ~27th percentile). The flaw is an incomplete fix for CVE-2025-61927 and is remediated in happy-dom 20.0.2.

RemediationAI

Vendor-released patch: upgrade happy-dom to 20.0.2 or later - this is the primary and complete fix, and it retrofits the earlier partial mitigation by adding --frozen-intrinsics to the server-renderer worker's execArgv alongside --disallow-code-generation-from-strings, freezing intrinsics so prototype pollution cannot be used to recover references such as process; confirm the upgrade actually lands in your dependency tree with npm ls happy-dom, since transitive pinning frequently keeps 19.x/20.0.x in place. If you cannot upgrade immediately, the most effective compensating control is to stop evaluating untrusted JavaScript: set enableJavaScriptEvaluation to false (or avoid enabling it) for any content you do not fully control, accepting that legitimate scripted pages will not execute and some rendering tests will change behavior. As a second layer, run any happy-dom instance that must evaluate untrusted markup in an isolated, low-privilege process or container with no ambient credentials, no writable host mounts and outbound network egress blocked or restricted - this limits the blast radius of the demonstrated command-execution primitive (process.binding('spawn_sync') spawning child processes) but does not remove the underlying bypass, and it carries operational cost and possible breakage of legitimate outbound features. Do not rely on --disallow-code-generation-from-strings alone; the advisory explicitly documents that it is insufficient. Patch details and the proof-of-concept are at https://github.com/capricorn86/happy-dom/security/advisories/GHSA-qpm2-6cq5-7pq5, and the fixing change is in https://github.com/capricorn86/happy-dom/commit/f4bd4ebe3fe5abd2be2bcea1c07043c8b0b70eea.

Affected Packages

npm happy-dom fix: 20.0.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

happy-dom emulates a browser DOM in Node.js, and its @happy-dom/server-renderer spawns a worker thread/child process whose execArgv includes V8 flags intended to make untrusted script safe. The earlier hardening added --disallow-code-generation-from-strings, which blocks eval/Function-style code generation, but the untrusted script and the host application still share the same V8 Isolate and process, so a prototype-pollution payload (CWE-1321) can still mutate intrinsics such as Object.prototype.hasOwnProperty. Because the polluted built-in is invoked by Node.js internals and user code alike, the attacker can use the altered call as a gadget to recover privileged references - the advisory demonstrates retrieving process and then reaching child_process internals such as process.binding('spawn_sync') to construct a spawnSync and execute shell commands. The published fix (commit f4bd4ebe3fe5abd2be2bcea1c07043c8b0b70eea) adds --frozen-intrinsics alongside --disallow-code-generation-from-strings in the worker's execArgv, freezing the intrinsic objects so prototype pollution cannot take hold; the change also updates ServerRenderer.test.ts assertions to expect both flags. Package data identifies npm/happy-dom as vulnerable in the range >= 19.0.0, < 20.0.2, fixed in 20.0.2; the advisory notes further gadget avenues (e.g. manipulation of require via universal gadgets) as an open concern. Note that the vendor-supplied CVSS v4.0 vector rates privileges required as low (PR:L) with passive user interaction (UI:P), whereas the independent assessment uses CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - network reachable, no privileges required, high confidentiality, integrity and availability impact, with scope change because the compromised worker/host process is outside the vulnerable component's intended security boundary. The AC:H reflects the configuration precondition rather than any exploitation complexity once that precondition is met.

Know when Prototype Pollution gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 9.4 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
vuln.today AI 9.0 CRITICAL

AV:N as content arrives over the network and AC:H because exploitation depends on the non-default JavaScript-evaluation configuration; the untrusted-script author needs no credentials (PR:N), and escaping the Isolate to the host process gives S:C with full C/I/A via command execution.

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 8.3 HIGH

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

DescriptionCVE.org

In versions before 20.0.2, it was found that --disallow-code-generation-from-strings is not sufficient for isolating untrusted JavaScript in happy-dom. The untrusted script and the rest of the application still run in the same Isolate/process, so attackers can deploy prototype pollution payloads to hijack important references like "process" in the example below, or to hijack control flow via flipping checks of undefined property. This vulnerability is due to an incomplete fix for CVE-2025-61927. The vulnerability is fixed in 20.0.2.

Executive ViewAI

Why It Matters

happy-dom, a JavaScript DOM library widely used for server-side rendering and testing in Node.js applications, contains a critical sandbox-escape flaw (CVE-2025-62410) that allows attacker-supplied markup to execute operating-system commands inside the host Node.js process. The risk is concentrated rather than universal: exploitation requires the embedding application to enable JavaScript evaluation and to feed it untrusted markup, a non-default configuration, so the population of exposed services is far smaller than the raw severity score implies. For any team running that configuration, a successful attack could grant an external party command execution on production infrastructure, making dependency inventory and rapid upgrade to happy-dom 20.0.2 the priority.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 73% exploitable
Prevalence
Medium
popular npm DOM library, but mainly test/SSR tooling
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

47
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +47
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-34621 HIGH POC
8.6 Apr 11

Prototype pollution in Adobe Acrobat Reader versions 24.001.30356, 26.001.21367 and earlier enables arbitrary code execu

CVE-2021-23450 CRITICAL POC
9.8 Dec 17

All versions of package dojo are vulnerable to Prototype Pollution via the setObject function. Rated critical severity (

CVE-2024-56059 CRITICAL
9.8 Dec 18

Prototype pollution in the farinspace Partners WordPress plugin (versions up to and including 0.2.0) enables remote unau

CVE-2021-23383 CRITICAL POC
9.8 May 04

The package handlebars before 4.7.7 are vulnerable to Prototype Pollution when selecting certain compiling options to co

CVE-2020-7788 CRITICAL POC
9.8 Dec 11

This affects the package ini before 1.3.6. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitabl

CVE-2020-28271 CRITICAL POC
9.8 Nov 12

Prototype pollution vulnerability in 'deephas' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service

CVE-2023-38894 CRITICAL POC
9.8 Aug 16

A Prototype Pollution issue in Cronvel Tree-kit v.0.7.4 and before allows a remote attacker to execute arbitrary code vi

CVE-2024-24292 CRITICAL POC
9.8 Mar 28

A Prototype Pollution issue in Aliconnect /sdk v.0.0.6 allows an attacker to execute arbitrary code via the aim function

CVE-2023-26121 CRITICAL POC
10.0 Apr 11

All versions of the package safe-eval are vulnerable to Prototype Pollution via the safeEval function, due to improper s

CVE-2021-23449 CRITICAL POC
10.0 Oct 18

This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr

CVE-2024-39011 CRITICAL POC
9.8 Jul 30

Prototype Pollution in chargeover redoc v2.0.9-rc.69 allows attackers to execute arbitrary code or cause a Denial of Ser

CVE-2024-38988 CRITICAL POC
9.8 Mar 28

alizeait unflatto <= 1.0.2 was discovered to contain a prototype pollution via the method exports.unflatto at /dist/inde

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy