{"id":"CVE-2026-115895","state":"PUBLISHED","title":"Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution","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.","publishedAt":"2026-10-23T21:32:24.999Z","updatedAt":"2026-10-30T18:43:41.641Z","severity":{"score":8.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"GitHub_M"},"assigner":"GitHub_M","products":["capricorn86 happy-dom"],"affected":[{"vendor":"capricorn86","product":"happy-dom","versions":[{"version":">= 17.0.0, < 21.0.4","status":"affected"}]}],"references":["https://github.com/capricorn86/happy-dom/security/advisories/GHSA-834v-8h66-3h79","https://github.com/capricorn86/happy-dom/pull/2537","https://github.com/capricorn86/happy-dom/commit/fd163520b74d9fa146be91f7b4e4f46d6cccbe13","https://github.com/capricorn86/happy-dom/releases/tag/v21.0.4"],"weaknesses":["CWE-94"],"ingestedAt":"2026-10-30T18:54:06.496Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/115xxx/CVE-2026-115895.json","commit":"b345e92d739b367e3638a015ed08039f20b0227b","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-115895","state":"PUBLISHED","datePublished":"2026-10-23T21:32:24.999Z","dateUpdated":"2026-10-30T18:43:41.641Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-10-23T19:37:27.177Z"},"containers":{"cna":{"title":"Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"capricorn86","product":"happy-dom","versions":[{"version":">= 17.0.0, < 21.0.4","status":"affected"}]}],"references":[{"url":"https://github.com/capricorn86/happy-dom/security/advisories/GHSA-834v-8h66-3h79","name":"https://github.com/capricorn86/happy-dom/security/advisories/GHSA-834v-8h66-3h79","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/capricorn86/happy-dom/pull/2537","name":"https://github.com/capricorn86/happy-dom/pull/2537","tags":["x_refsource_MISC"]},{"url":"https://github.com/capricorn86/happy-dom/commit/fd163520b74d9fa146be91f7b4e4f46d6cccbe13","name":"https://github.com/capricorn86/happy-dom/commit/fd163520b74d9fa146be91f7b4e4f46d6cccbe13","tags":["x_refsource_MISC"]},{"url":"https://github.com/capricorn86/happy-dom/releases/tag/v21.0.4","name":"https://github.com/capricorn86/happy-dom/releases/tag/v21.0.4","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","baseScore":8.8,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-94","lang":"en","description":"CWE-94: Improper Control of Generation of Code ('Code Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-10-23T21:32:24.999Z"},"source":{"advisory":"GHSA-834v-8h66-3h79","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/capricorn86/happy-dom/security/advisories/GHSA-834v-8h66-3h79","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-10-30T18:43:36.234800Z","id":"CVE-2026-115895","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-30T18:43:41.641Z"}}]}}}