Description
The ESM compiler in [email protected] does not validate imported local binding aliases before interpolating them into generated JavaScript.
As a result, an invalid ESM import alias can be transformed into a valid JavaScript destructuring default initializer and executed.
Recommendation
Update the happy-dom package to the latest compatible version. Followings are version details:
- Affected version(s): >= 17.0.0, <= 21.0.3
- Patched version(s): 21.0.4
References
Could your website be exposed too?
SmartScanner can check your website for Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code - CVE-2026-33943
- Happy DOM: VM Context Escape can lead to Remote Code Execution - CVE-2025-61927
- happy-dom allows for server side code to be executed by a <script> tag - CVE-2024-51757
- happy-dom's `--disallow-code-generation-from-strings` is not sufficient for isolating untrusted JavaScript - CVE-2025-62410


