Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. happy-dom
  4. ›
  5. CVE-2026-115895

CVE-2026-115895: Happy DOM: Incomplete fix for CVE-2026-33943: unsanitized import alias leads to host code execution

October 23, 2026

The ESM compiler in happy-dom@20.14.5 does not validate imported local binding aliases before interpolating them into generated JavaScript.

As a result, an invalid ESM import alias can be transformed into a valid JavaScript destructuring default initializer and executed.

This appears to be an alternate injection path and incomplete remediation of GHSA-6q6h-j7hj-3r64 / CVE-2026-33943. The previous fix validates importName in the local export { ... } handler, but the named import handler still places an unvalidated alias directly into code context.

These issues were confirmed through the public Window and <script type="module"> APIs using the published happy-dom npm package. The PoC reaches the Node.js host process, obtains node:fs, and creates a proof directory on the host filesystem.

References

  • github.com/advisories/GHSA-834v-8h66-3h79
  • github.com/capricorn86/happy-dom/commit/fd163520b74d9fa146be91f7b4e4f46d6cccbe13
  • github.com/capricorn86/happy-dom/pull/2537
  • github.com/capricorn86/happy-dom/releases/tag/v21.0.4
  • github.com/capricorn86/happy-dom/security/advisories/GHSA-834v-8h66-3h79
  • nvd.nist.gov/vuln/detail/CVE-2026-115895

Code Behaviors & Features

Detect and mitigate CVE-2026-115895 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 17.0.0 before 21.0.4

Fixed versions

  • 21.0.4

Solution

Upgrade to version 21.0.4 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

npm/happy-dom/CVE-2026-115895.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:04 +0000.