CVE-2024-51757 Fixes security vulnerability that allowed for server side code to be executed by a <script> tag
An attacker can execute arbitrary server-side code by injecting a script tag into the happy-dom JavaScript library environment.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-51757?
CVE-2024-51757 is a critical code injection vulnerability in capricorn86 happy-dom, published on 6 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
happy-dom is a JavaScript implementation of a web browser without its graphical user interface. Versions of happy-dom prior to 15.10.2 may execute code on the host via a script tag. This would execute code in the user context of happy-dom. Users are advised to upgrade to version 15.10.2. There are no known workarounds for this vulnerability.
Which versions are affected by CVE-2024-51757?
2 open source packages ship an affected version, including happy-dom.
| Package | Affected | Fixed in |
|---|---|---|
happy-dom npm | All versions | 15.10.2 |
happy-dom npm | All versions | 15.10.2 |
How do I fix CVE-2024-51757?
Upgrade happy-dom to 15.10.2 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2024-51757 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-51757 exists.
Sources
Also known as CLSA-2026-1790102017, CLSA-2026-1792254628, CLSA-2026-1792866963, GHSA-96g7-g7g9-jxw8.