Skip to main content
← All vulnerabilities
CVE-2026-118661GHSA-5FPQ-26GF-QWCREUVD-2026-112468

Happy DOM: Cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 20.14.6
None on Exploit-DB, Metasploit or GitHub

Summary

Happy DOM, a JavaScript library that simulates a web browser on the server, is affected through its cookie handling, which fails to properly restrict which domains a cookie can be set for. An attacker can use this to plant forged cookies that are then sent to a victim site, potentially enabling cookie injection or session fixation in server-side rendering or prerendering applications.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

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.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • capricorn86 happy-dom

    fixed in 20.14.6

  • happy-domnpm

    fixed in 20.14.6

References 4

GitHub · capricorn86/happy-dom