cve.bz

CVE-2026-115895 capricorn86 happy-dom: Code Injection

8.8 highEPSS 0.5%Fix available

High (8.8) in capricorn86 happy-dom. EPSS 0.5% estimated probability of exploitation activity in the next 30 days. Fixed in happy-dom 21.0.4.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.5% (unchanged from 0.5% a week ago) estimated probability of exploitation activity in the next 30 days; 41st percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2026-10-30. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Fix and patched versions

  • happy-dom (npm): fixed in 21.0.4

Ask an AI about this CVE

Show the promptExplain CVE-2026-115895 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-115895?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-115895?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-115895 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
capricorn86 happy-dom>= 17.0.0, < 21.0.4

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-834v-8h66-3h79npmhappy-dom>=17.0.0 <21.0.421.0.4

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is rated as Important because an attacker can execute arbitrary commands in the host Node.js runtime without requiring local system credentials. Exposure depends on the application processing untrusted web assets or scripts with JavaScript execution enabled. Deployments that parse only trusted markup or maintain script evaluation disabled are not vulnerable to this flaw.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/gateway-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/gateway-rhel9Not affected
Red Hat Ansible Automation Platform 2automation-gatewayFix deferred
Red Hat Ansible Automation Platform 2automation-platform-uiNot affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-feature-server-rhel9Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-115895.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON