Cookie scope forgery in Happy DOM lets attackers set victim cookies
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
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
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| capricorn86 | happy-dom | before 20.14.6 | 20.14.6 | Patch available | CNA |
| — | happy-dom (npm) | before 20.14.6 | 20.14.6 | Patch available | GHSA-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 →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-28 Threatist record created from CVE-2026-118661
- 2026-10-28 Alias added: GHSA-5fpq-26gf-qwcr
- 2026-10-28 Fix available: npm/[email protected] · GHSA-5fpq-26gf-qwcr
- 2026-10-28 CVSS score added · GHSA-5fpq-26gf-qwcr
- 2026-10-28 Weakness changed · GHSA-5fpq-26gf-qwcr
- 2026-10-28 5 new references · GHSA-5fpq-26gf-qwcr
- 2026-10-30 Priority changed: MEDIUM → LOW
- 2026-10-30 Affected versions changed · Red Hat
- 2026-10-30 CVSS score added · Red Hat
- 2026-11-03 CISA SSVC decision points changed
- 2026-11-03 Priority changed: LOW → HIGH
References
Other 5
- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr
- https://github.com/capricorn86/happy-dom/pull/2477
- https://github.com/capricorn86/happy-dom/commit/f21dbd7d0a0c63cdd41954ba5d0f05def4e0f2b3
- https://github.com/capricorn86/happy-dom/releases/tag/v20.14.6
- https://github.com/capricorn86/happy-dom
More capricorn86 vulnerabilities
- 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
Sources
- CVE-2026-118661 · CVE Program
- CVE-2026-118661 · NVD
- FIRST EPSS
- GHSA-5fpq-26gf-qwcr · GitHub Advisory Database · CC BY 4.0
- CVE-2026-118661 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences