CVE-2025-62410 --disallow-code-generation-from-strings is not sufficient for isolating untrusted JavaScript in happy-dom
Attackers can execute arbitrary code and escalate privileges via prototype pollution in happy-dom due to insufficient isolation of untrusted JavaScript.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-62410?
CVE-2025-62410 is a critical code injection vulnerability in capricorn86 happy-dom, published on 15 Oct 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-1321
Which versions are affected by CVE-2025-62410?
2 open source packages ship an affected version, including happy-dom.
| Package | Affected | Fixed in |
|---|---|---|
happy-dom npm | From 19.0.0 | 20.0.2 |
happy-dom npm | From 19.0.0 | 20.0.2 |
How do I fix CVE-2025-62410?
Upgrade happy-dom to 20.0.2 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2025-62410 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-62410 exists.
Sources
Also known as GHSA-qpm2-6cq5-7pq5.