happy-dom CVE-2025-62410
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply untrusted HTML/JS to happy-dom with JS eval enabled
-
ExploitDeploy prototype pollution to hijack process reference
-
ExecutionInvoke process.binding spawn_sync
-
ImpactExecute 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
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.
Primary rating from Vendor (github).
CVSS VectorVendor: github
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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
More in Prototype Pollution
View allPrototype pollution in Adobe Acrobat Reader versions 24.001.30356, 26.001.21367 and earlier enables arbitrary code execu
All versions of package dojo are vulnerable to Prototype Pollution via the setObject function. Rated critical severity (
Prototype pollution in the farinspace Partners WordPress plugin (versions up to and including 0.2.0) enables remote unau
The package handlebars before 4.7.7 are vulnerable to Prototype Pollution when selecting certain compiling options to co
This affects the package ini before 1.3.6. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitabl
Prototype pollution vulnerability in 'deephas' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service
A Prototype Pollution issue in Cronvel Tree-kit v.0.7.4 and before allows a remote attacker to execute arbitrary code vi
A Prototype Pollution issue in Aliconnect /sdk v.0.0.6 allows an attacker to execute arbitrary code via the aim function
All versions of the package safe-eval are vulnerable to Prototype Pollution via the safeEval function, due to improper s
This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr
Prototype Pollution in chargeover redoc v2.0.9-rc.69 allows attackers to execute arbitrary code or cause a Denial of Ser
alizeait unflatto <= 1.0.2 was discovered to contain a prototype pollution via the method exports.unflatto at /dist/inde
NVD
CVE.org
EPSS
GitHub
Exploit-DB