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.

Project Subscriptions

No data.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-6q6h-j7hj-3r64 Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code
Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Sat, 28 Mar 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-917
References
Metrics threat_severity

None

threat_severity

Important


Sat, 28 Mar 2026 03:15:00 +0000

Type Values Removed Values Added
Description 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.
Title Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-03-27T21:58:16.284Z

Reserved: 2026-03-24T19:50:52.104Z

Link: CVE-2026-33943

cve-icon Vulnrichment

Updated: 2026-03-27T21:58:10.989Z

cve-icon NVD

Status : Received

Published: 2026-03-27T22:16:21.393

Modified: 2026-03-27T22:16:21.393

Link: CVE-2026-33943

cve-icon Redhat

Severity : Important

Publid Date: 2026-03-27T21:15:19Z

Links: CVE-2026-33943 - Bugzilla

cve-icon OpenCVE Enrichment

No data.

Weaknesses