High severity · published Oct 10, 2025
CVE-2025-61927
Happy-DOM has VM Context Escape
7.2
CVSS
0.6%
EPSS
No
On KEV
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.
Exploitation
Is it being used?
Exploit prediction (EPSS)0.6% · higher than 51% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
HA
happy-dom · capricorn86
< 20.0.0 · source: vendor
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2025-61927
CVE.org
https://www.cve.org/CVERecord?id=CVE-2025-61927
github.com
https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405
github.com
https://github.com/capricorn86/happy-dom/security/advisories/GHSA-37j7-fg3j-429f
More from happy-dom
9.8
CVE-2026-33943
Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code
9.4
CVE-2025-62410
--disallow-code-generation-from-strings is not sufficient for isolating untrusted JavaScript in happy-dom
9.3
CVE-2024-51757
Fixes security vulnerability that allowed for server side code to be executed by a <script> tag
8.8
CVE-2026-115895
Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution
8.6
CVE-2026-118660
Happy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTML
