CVE-2025-61927 Happy-DOM has VM Context Escape

High 7.2 Published Updated

Happy-DOM allows VM context escape via JavaScript evaluation, enabling remote code execution on the host system.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-61927?

CVE-2025-61927 is a high-severity code injection vulnerability in capricorn86 happy-dom, published on 10 Oct 2025. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-94

Which versions are affected by CVE-2025-61927?

2 open source packages ship an affected version, including happy-dom.

PackageAffectedFixed in
happy-dom npmAll versions20.0.0
happy-dom npmAll versions20.0.0

How do I fix CVE-2025-61927?

Upgrade happy-dom to 20.0.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-61927 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-61927 exists.

Sources

Also known as CLSA-2026-1789467187, CLSA-2026-1792254627, CLSA-2026-1792866960, GHSA-37j7-fg3j-429f.

Is CVE-2025-61927 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free