Skip to main content

CVE-2026-115895: CWE-94: Improper Control of Generation of Code ('Code Injection') in capricorn86 happy-dom

0
High
VulnerabilityCVE-2026-115895cvecve-2026-115895cwe-94
Published: 10/23/2026 (10/23/2026, 21:32:24 UTC)
Source: CVE Database V5
Vendor/Project: capricorn86
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

capricorn86

happy-dom

Affected versions
>=17.0.0 <21.0.4
happy-dom
pkg:npm/happy-dom
Affected versions
>=17.0.0 <21.0.4

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/23/2026, 21:50:13 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses