Happy DOM: Cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 20.14.6
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- 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
- CVE published
- First seen by cve.now
Affected versions
- capricorn86 happy-dom
fixed in 20.14.6
- happy-domnpm
fixed in 20.14.6