# CVE-2026-115895 - Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution

DevFeed: [CVE-2026-115895 - Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution](<https://devfeed.tech/articles/cve-2026-115895-happy-dom-incomplete-fix-for-cve-2026-33943-unsanitized-import-alias-leads-to-host-code-execution-98525.md>)

Original publisher: [Read original article](<https://cvefeed.io/vuln/detail/CVE-2026-115895>)

Author: CVEFEED.io; github.com

Published: 2026-10-23T22:16:58Z

Content type: news

Language: en

Sources: [Latest High/Critical Vulnerabilitiy Feed](<https://devfeed.tech/sources/latest-high-critical-vulnerabilitiy-feed.md>)

Topics: [import](<https://devfeed.tech/topics/import.md>), [destructuring](<https://devfeed.tech/topics/destructuring.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [capricorn86](<https://devfeed.tech/tags/capricorn86.md>), [code-execution](<https://devfeed.tech/tags/code-execution.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [cve-2026-115895](<https://devfeed.tech/tags/cve-2026-115895.md>), [esm](<https://devfeed.tech/tags/esm.md>), [fixed](<https://devfeed.tech/tags/fixed.md>), [function](<https://devfeed.tech/tags/function.md>), [happy-dom](<https://devfeed.tech/tags/happy-dom.md>), [html](<https://devfeed.tech/tags/html.md>), [identifier](<https://devfeed.tech/tags/identifier.md>), [import](<https://devfeed.tech/tags/import.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [json](<https://devfeed.tech/tags/json.md>), [malicious](<https://devfeed.tech/tags/malicious.md>), [module](<https://devfeed.tech/tags/module.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [process](<https://devfeed.tech/tags/process.md>), [version](<https://devfeed.tech/tags/version.md>)

## AI overview

Happy DOM versions 17.0.0 through 21.0.3 have a residual code-execution flaw in ECMAScriptModuleCompiler: named ESM import aliases are inserted into generated destructuring bindings without checking that they are valid JavaScript binding identifiers. When JavaScript evaluation is enabled, attacker-controlled HTML or module source can exploit an invalid alias that compiles into a valid default initializer to execute code in the Node.js host process. The demonstrated path uses a JSON module import attribute to keep the generated function syntactically valid through circular-import handling. The earlier CVE-2026-33943 fix validated a different import-name path and missed this alias. The issue is fixed in version 21.0.4.

## Source excerpt

CVE ID :CVE-2026-115895 Published : Oct. 23, 2026, 10:16 p.m. | 1 hour, 38 minutes ago Description :Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. From 17.0.0 until 21.0.4, packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts accepts a named ESM import alias without validating that it is a JavaScript binding identifier before inserting it into a generated destructuring binding. With enableJavaScriptEvaluation enabled, attacker-controlled HTML or module source can use an invalid alias that becomes a valid default initializer after compilation, causing the generated JavaScript to execute in the Node.js host process. The demonstrated reachable path uses a JSON module import attribute, which prevents the malicious alias from being emitted again in a later ESM circular-import assignment and keeps the generated function syntactically valid. This incomplete fix for CVE-2026-33943 is a distinct residual path because the earlier remediation validated the local export importName path but not the named-import alias. This issue is fixed in version 21.0.4. Severity: 8.8 | HIGH Visit the link for more details, such as CVSS details, affected products, timeline, and more...