Skip to content

Commit 72da79c

Browse files
brentrockwoodclaude
andcommitted
fix: upgrade happy-dom and pin transitive deps to fix known CVEs
Addresses three advisories identified by npm audit: - @happy-dom/global-registrator: ^15.11.0 → ^20.9.0 GHSA-37j7-fg3j-429f (critical) — VM context escape → RCE GHSA-6q6h-j7hj-3r64 (high) — unsanitized export names executed as code GHSA-w4gp-fjgq-3q4g (high) — fetch credentials leak - rollup (transitive, via overrides): 3.29.5 → 3.30.0 GHSA-mw96-cpmx-2vgc (high) — arbitrary file write via path traversal - postcss (transitive, via overrides): 8.5.6 → 8.5.14 GHSA-qx2v-qp2m-jg93 (moderate) — XSS via unescaped </style> in output happy-dom v20 requires a document URL when using relative-URL fetch calls, so GlobalRegistrator.register() is updated to pass url: 'http://localhost/' as recommended by the library. Test pass/fail counts are unchanged (38/293 failures are all pre-existing and caused by the absent WASM build artifact). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6a1a50d commit 72da79c

3 files changed

Lines changed: 26 additions & 16 deletions

File tree

bun.lock

Lines changed: 20 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

happydom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import { GlobalRegistrator } from '@happy-dom/global-registrator';
1313

1414
// Register Happy DOM globals (window, document, etc.)
15-
GlobalRegistrator.register();
15+
GlobalRegistrator.register({ url: 'http://localhost/' });
1616

1717
// Mock Canvas 2D Context
1818
// Happy DOM doesn't provide canvas rendering APIs, so we mock them for testing.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
"publishConfig": {
4343
"access": "public"
4444
},
45+
"overrides": {
46+
"rollup": "^3.30.0",
47+
"postcss": "^8.5.10"
48+
},
4549
"scripts": {
4650
"dev": "vite --port 8000",
4751
"demo": "node demo/bin/demo.js",
@@ -63,7 +67,7 @@
6367
},
6468
"devDependencies": {
6569
"@biomejs/biome": "^1.9.4",
66-
"@happy-dom/global-registrator": "^15.11.0",
70+
"@happy-dom/global-registrator": "^20.9.0",
6771
"@types/bun": "^1.3.2",
6872
"@xterm/headless": "^5.5.0",
6973
"@xterm/xterm": "^5.5.0",

0 commit comments

Comments
 (0)