Read the docs

Code injection in Happy DOM import aliases allows host code execution

Priority HIGH 73CWE-94Published · Updated

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

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00473 41st percentileScored 2026-11-07
Fix Partial happy-dom (capricorn86): 21.0.4happy-dom (npm): 21.0.4Red Hat: 2 without a fix

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

VendorProductAffected versionsFixed inStatusSource
capricorn86happy-dom17.0.0 to before 21.0.421.0.4Patch availableCNA
—happy-dom (npm)17.0.0 to before 21.0.421.0.4Patch availableGHSA-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 →

ProductStatusPlan or fix
Red Hat Ansible Automation Platform 2AffectedNo fix yet: Fix deferred
Red Hat OpenShift AI (RHOAI)AffectedNo fix yet
Not affected: 1 product
  • Red Hat Ansible Automation Platform 2

Timeline

  1. 2026-10-23 Threatist record created from CVE-2026-115895
  2. 2026-10-23 Alias added: GHSA-834v-8h66-3h79
  3. 2026-10-23 Fix available: npm/[email protected] · GHSA-834v-8h66-3h79
  4. 2026-10-23 CVSS score added · GHSA-834v-8h66-3h79
  5. 2026-10-23 Weakness changed · GHSA-834v-8h66-3h79
  6. 2026-10-23 5 new references · GHSA-834v-8h66-3h79
  7. 2026-10-24 Priority changed: MEDIUM → LOW
  8. 2026-10-24 Affected versions changed · Red Hat
  9. 2026-10-24 CVSS score added · Red Hat
  10. 2026-10-30 Affected versions changed · Red Hat
  11. 2026-10-30 CISA SSVC decision points changed
  12. 2026-10-30 Priority changed: LOW → HIGH

References

  • 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
See all 8 →

Sources