CVE-2026-115895: CWE-94: Improper Control of Generation of Code ('Code Injection') in capricorn86 happy-dom
Description
CVE-2026-115895 is a high-severity code injection vulnerability in the capricorn86 happy-dom JavaScript library. Versions from 17.0.0 up to but not including 21.0.4 improperly validate named ESM import aliases, allowing attacker-controlled input to execute arbitrary code in the Node.js host process when enableJavaScriptEvaluation is enabled. This issue is a residual path from an earlier incomplete fix and is resolved in version 21.0.4.
CVSS v3.1
Score 8.8high
Affected software
capricorn86
happy-dom
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Happy DOM is a JavaScript implementation of a web browser without a GUI. Between versions 17.0.0 and 21.0.4, the ECMAScriptModuleCompiler.ts module accepts named ESM import aliases without validating that they are valid JavaScript binding identifiers before inserting them into generated destructuring bindings. When enableJavaScriptEvaluation is enabled, an attacker can supply a malicious alias that compiles into a valid default initializer, causing arbitrary JavaScript execution in the Node.js host process. This vulnerability is a distinct residual path from a prior fix (CVE-2026-33943) that only validated the local export importName but not the named-import alias. The vulnerability is fixed in version 21.0.4.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary JavaScript code within the Node.js host process running happy-dom, potentially leading to full compromise of the host environment. The vulnerability has a CVSS 3.1 score of 8.8, indicating high impact on confidentiality, integrity, and availability. There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is fixed in happy-dom version 21.0.4. Users should upgrade to version 21.0.4 or later to remediate this issue. No other mitigations or temporary workarounds are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-23T19:37:27.177Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6adbd340d73cc49347c1eff1
Added to database: 10/23/2026, 21:36:00 UTC
Last enriched: 10/23/2026, 21:50:13 UTC
Last updated: 10/23/2026, 21:50:50 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.