{"id":"CVE-2026-33943","published":"2026-03-27T21:15:19Z","modified":"2026-07-15T01:05:08Z","title":"Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code","vendor":"capricorn86","product":"happy-dom","tier":"tail","description":{"text":"Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. In versions 15.10.0 through 20.8.7, a code injection vulnerability in `ECMAScriptModuleCompiler` allows an attacker to achieve Remote Code Execution (RCE) by injecting arbitrary JavaScript expressions inside `export { }` declarations in ES module scripts processed by happy-dom. The compiler directly interpolates unsanitized content into generated code as an executable expression, and the quote filter does not strip backticks, allowing template literal-based payloads to bypass sanitization. Version 20.8.8 fixes the issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00747,"percentile":0.558,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-917","name":"Improper Neutralization of Special Elements used in an Expression Language Statement"}],"references":[{"url":"https://github.com/capricorn86/happy-dom/security/advisories/GHSA-6q6h-j7hj-3r64","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/capricorn86/happy-dom/commit/5437fdf8f13adb9590f9f52616d9f69c3ee8db3c","tags":["x_refsource_MISC"]},{"url":"https://github.com/capricorn86/happy-dom/releases/tag/v20.8.8","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-33943","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2452522","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33943.json","tags":["x_sadp-csaf-vex"]}],"priority":{"score":17.3,"factors":[{"name":"EPSS percentile","points":11.16},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"capricorn86","affectedVersions":[{"vendor":"capricorn86","product":"happy-dom","versions":[">= 15.10.0, < 20.8.8"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-03-27T21:58:00.418466Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"happy-dom","vulnerableRanges":[">=15.10.0, <20.8.8"],"patched":["20.8.8"],"from":["GHSA-6q6h-j7hj-3r64"],"provenance":"source"}],"summary":{"text":"A code injection flaw in the ECMAScriptModuleCompiler component of Happy DOM, a JavaScript browser implementation without a graphical interface, lets unsanitized export names in ES module scripts be interpolated into generated code as executable expressions. An attacker who can get a malicious module script processed by Happy DOM, with the victim needing to take some action to trigger it, can achieve remote code execution, with backtick-based template literal payloads bypassing the existing quote filter.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:57:35Z"},"euvd":{"id":"EUVD-2026-16864","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-capricorn86-happy-dom-cve-2025-61927","parents":[{"from":"CVE-2025-61927","to":"CVE-2026-33943","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts"],"commits":["https://github.com/capricorn86/happy-dom/commit/819d15ba289495439eda8be360d92a614ce22405","https://github.com/capricorn86/happy-dom/commit/de438ad72921c69793584aa657b48d3655dfac97","https://github.com/capricorn86/happy-dom/commit/5437fdf8f13adb9590f9f52616d9f69c3ee8db3c"],"basis":"shared function","functions":["ECMAScriptModuleCompiler"]}]}],"children":[{"from":"CVE-2026-33943","to":"CVE-2026-115895","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"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.","from":"CVE.org","in":"CVE-2026-115895"},{"kind":"same-code","provenance":"machine","files":["packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts"],"commits":["https://github.com/capricorn86/happy-dom/commit/fd163520b74d9fa146be91f7b4e4f46d6cccbe13","https://github.com/capricorn86/happy-dom/commit/5437fdf8f13adb9590f9f52616d9f69c3ee8db3c"],"basis":"shared function","functions":["ECMAScriptModuleCompiler"]}]}],"packageHistory":[{"cve":"CVE-2024-51757","published":"2024-11-06","fixed":"15.10.2","kev":false},{"cve":"CVE-2025-61927","published":"2025-10-10","fixed":"20.0.0","kev":false},{"cve":"CVE-2025-62410","published":"2025-10-15","fixed":"20.0.2","kev":false,"link":{"from":"CVE-2025-62410","to":"CVE-2026-33943","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:happy-dom","fromFixed":"20.0.2","toFixed":"20.8.8","daysApart":163}]}},{"cve":"CVE-2026-33943","published":"2026-03-27","fixed":"20.8.8","kev":false},{"cve":"CVE-2026-34226","published":"2026-03-27","fixed":"20.8.9","kev":false,"link":{"from":"CVE-2026-33943","to":"CVE-2026-34226","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"npm:happy-dom","fromFixed":"20.8.8","toFixed":"20.8.9","daysApart":0}]}},{"cve":"CVE-2026-118661","published":"2026-10-28","fixed":"20.14.6","kev":false},{"cve":"CVE-2026-118660","published":"2026-10-28","fixed":"21.0.0","kev":false}],"package":"npm:happy-dom"}}