Read the docs

Cookie scope forgery in Happy DOM lets attackers set victim cookies

Priority HIGH 68CWE-565Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
Low · Low · None
Fix status
Partial Red Hat: 2 without a fix

Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.

Summary

Happy DOM before 20.14.6, an npm package by capricorn86, accepts cookie Domain attributes unrelated to the origin that sets them, including public suffixes. It also matches cookies to hostnames that share a suffix without enforcing a DNS-label boundary (CWE-565). In server-side rendering or prerendering applications that contact attacker-controlled origins before requesting a victim origin, a remote attacker can plant a forged cookie, enabling cookie injection or session fixation.

Written with Claude Haiku 5.5 from the sources below · 2026-11-03

Description from the CNA

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Prior to 20.14.6, Happy DOM's CookieContainer in src/cookie/CookieContainer.ts does not correctly validate or match Domain cookie attributes. It can accept a Domain unrelated to the origin setting the cookie, including a public suffix, and separately treats an unrelated suffix-sharing hostname as a match because cookieMatchesURL does not enforce a DNS-label boundary. In server-side rendering and prerendering applications that contact attacker-controlled origins and then make requests to a victim origin, these behaviors can plant and deliver a forged cookie, enabling cookie injection or session fixation. This issue is fixed in version 20.14.6.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00272 19th percentileScored 2026-11-07
Fix Partial happy-dom (capricorn86): 20.14.6happy-dom (npm): 20.14.6Red Hat: 2 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Partial

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-dombefore 20.14.620.14.6Patch availableCNA
—happy-dom (npm)before 20.14.620.14.6Patch availableGHSA-5fpq-26gf-qwcr
  • happy-dom Vendorcapricorn86 Affected before 20.14.6 Fixed in 20.14.6 Patch available CNA
  • happy-dom (npm) Vendor— Affected before 20.14.6 Fixed in 20.14.6 Patch available GHSA-5fpq-26gf-qwcr

Remediation

Upgrade the happy-dom npm package to version 20.14.6, which fixes this issue. Red Hat Ansible Automation Platform 2 and Red Hat OpenShift AI (RHOAI) are affected, and Red Hat's plan for both is none available.

Written with Claude Haiku 5.5 from the sources below · 2026-11-03

  • Fix · CNA happy-dom (capricorn86) Fixed in 20.14.6
  • Fix · GHSA-5fpq-26gf-qwcr happy-dom (npm) Fixed in 20.14.6 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Moderate. 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: Fix deferred

Timeline

  1. 2026-10-28 Threatist record created from CVE-2026-118661
  2. 2026-10-28 Alias added: GHSA-5fpq-26gf-qwcr
  3. 2026-10-28 Fix available: npm/[email protected] · GHSA-5fpq-26gf-qwcr
  4. 2026-10-28 CVSS score added · GHSA-5fpq-26gf-qwcr
  5. 2026-10-28 Weakness changed · GHSA-5fpq-26gf-qwcr
  6. 2026-10-28 5 new references · GHSA-5fpq-26gf-qwcr
  7. 2026-10-30 Priority changed: MEDIUM → LOW
  8. 2026-10-30 Affected versions changed · Red Hat
  9. 2026-10-30 CVSS score added · Red Hat
  10. 2026-11-03 CISA SSVC decision points changed
  11. 2026-11-03 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-80004 Code injection in Happy DOM import aliases allows host code execution CVSS 3.1HIGH 8.8
  • 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
See all 8 →

Sources