Code injection in Happy DOM import aliases allows host code execution
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 2 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-94.
Summary
Happy DOM from 17.0.0 before 21.0.4 accepts named ESM import aliases without checking that they are valid JavaScript identifiers. The alias is inserted into generated code, so an invalid alias can become valid code that runs in the Node.js host process when enableJavaScriptEvaluation is enabled. This incomplete fix for CVE-2026-33943 is reached by a remote attacker who supplies HTML or module source, with user interaction required (CWE-94).
Written with Claude Haiku 5.5 from the sources below · 2026-10-31
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| capricorn86 | happy-dom | 17.0.0 to before 21.0.4 | 21.0.4 | Patch available | CNA |
| — | happy-dom (npm) | 17.0.0 to before 21.0.4 | 21.0.4 | Patch available | GHSA-834v-8h66-3h79 |
- happy-dom Vendorcapricorn86 Affected 17.0.0 to before 21.0.4 Fixed in 21.0.4 Patch available CNA
- happy-dom (npm) Vendor— Affected 17.0.0 to before 21.0.4 Fixed in 21.0.4 Patch available GHSA-834v-8h66-3h79
Remediation
Upgrade Happy DOM to version 21.0.4. Red Hat lists Red Hat Ansible Automation Platform 2 and Red Hat OpenShift AI (RHOAI) as affected, with a plan of none available.
Written with Claude Haiku 5.5 from the sources below · 2026-10-31
- Fix · CNA happy-dom (capricorn86) Fixed in 21.0.4
- Fix · GHSA-834v-8h66-3h79 happy-dom (npm) Fixed in 21.0.4 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet |
Not affected: 1 product
- Red Hat Ansible Automation Platform 2
Timeline
- 2026-10-23 Threatist record created from CVE-2026-115895
- 2026-10-23 Alias added: GHSA-834v-8h66-3h79
- 2026-10-23 Fix available: npm/[email protected] · GHSA-834v-8h66-3h79
- 2026-10-23 CVSS score added · GHSA-834v-8h66-3h79
- 2026-10-23 Weakness changed · GHSA-834v-8h66-3h79
- 2026-10-23 5 new references · GHSA-834v-8h66-3h79
- 2026-10-24 Priority changed: MEDIUM → LOW
- 2026-10-24 Affected versions changed · Red Hat
- 2026-10-24 CVSS score added · Red Hat
- 2026-10-30 Affected versions changed · Red Hat
- 2026-10-30 CISA SSVC decision points changed
- 2026-10-30 Priority changed: LOW → HIGH
References
Other 5
- 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
- https://github.com/capricorn86/happy-dom
More capricorn86 vulnerabilities
- TI-2024-34662 Fixes security vulnerability that allowed for server side code to be executed by a <script> tag CVSS 4.0CRITICAL 9.3
- TI-2026-26294 Happy DOM ECMAScriptModuleCompiler: unsanitized export names are interpolated as executable code CVSS 3.1CRITICAL 9.8
- TI-2025-38677 --disallow-code-generation-from-strings is not sufficient for isolating untrusted JavaScript in happy-dom CVSS 4.0CRITICAL 9.4
- TI-2026-82200 Server-side request forgery in Happy DOM server renderer proxy CVSS 3.1HIGH 7.5
- TI-2026-26521 Happy DOM's fetch credentials include uses page-origin cookies instead of target-origin cookies CVSS 3.1HIGH 7.5
- TI-2026-82202 Cookie scope forgery in Happy DOM lets attackers set victim cookies CVSS 3.1MEDIUM 6.5
Sources
- CVE-2026-115895 · CVE Program
- CVE-2026-115895 · NVD
- FIRST EPSS
- GHSA-834v-8h66-3h79 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-115895 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences