CVE-2025-61927 Details
Description
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Happy DOM v19 and lower contains a security vulnerability that puts the owner system at the risk of RCE (Remote Code Execution) attacks. A Node.js VM Context is not an isolated environment, and if the user runs untrusted JavaScript code within the Happy DOM VM Context, it may escape the VM and get access to process level functionality. It seems like what the attacker can get control over depends on if the process is using ESM or CommonJS. With CommonJS the attacker can get hold of the `require()` function to import modules. Happy DOM has JavaScript evaluation enabled by default. This may not be obvious to the consumer of Happy DOM and can potentially put the user at risk if untrusted code is executed within the environment. Version 20.0.0 patches the issue by changing JavaScript evaluation to be disabled by default.
A remote code execution vulnerability exists in Happy DOM versions prior to 20.0.0. This issue arises because the Node.js VM Context used by Happy DOM is not isolated, allowing untrusted JavaScript code to escape the VM and access process-level functionality. The impact varies depending on whether the process uses ECMAScript Modules (ESM) or CommonJS; in CommonJS, the attacker can exploit the 'require()' function to import modules. By default, Happy DOM enables JavaScript evaluation, which can inadvertently expose users to risks if they execute untrusted code.
Users are advised to update Happy DOM to version 20.0.0 or later, where JavaScript evaluation is disabled by default. If JavaScript evaluation is necessary, it is recommended to run Node.js with the '--disallow-code-generation-from-strings' flag to prevent exploitation.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 10, 2025CISA-ADP
Assessed Oct 10, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405 | [email protected] | Source CodeVendor |
| https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Happy DOM | All versions |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 8, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 10, 2025 | New CVE Received | [email protected] |
Volerion