CVE-2026-118661
Happy DOM: Cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies
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.
Fixes and workarounds
Fix
happy-dom (npm): OSV reports a fixed version 20.14.6. Check the advisory for supported release branches.
Source: OSV GHSA-5fpq-26gf-qwcrAffected products and versions
| Product | Versions | Authority |
|---|---|---|
| happy-dom capricorn86 |
< 20.14.6 (affected) | CNA: GitHub_M |
happy-domhappy-dom
npm |
≥ 0; < 20.14.6 (affected, semver); OSV events: introduced 0; fixed 20.14.6Source events (semver)
Other versions: unaffected |
OSV GHSA-5fpq-26gf-qwcr |
Version ranges are source assertions. Check the vendor advisory and your installed configuration before determining exposure.
CVSS assessments
| Version / score | Vector | Authority |
|---|---|---|
| 3.1 / 6.5 medium |
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N | CNA: GitHub_M |
Exploit evidence
- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr
exploit · ADP: CISA-ADP
References
- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcrCNA: GitHub_M · x_refsource_CONFIRM
- https://github.com/capricorn86/happy-dom/pull/2477CNA: GitHub_M · x_refsource_MISC
- https://github.com/capricorn86/happy-dom/commit/f21dbd7d0a0c63cdd41954ba5d0f05def4e0f2b3CNA: GitHub_M · x_refsource_MISC
- https://github.com/capricorn86/happy-dom/releases/tag/v20.14.6CNA: GitHub_M · x_refsource_MISC
- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcrADP: CISA-ADP · exploit
- https://github.com/advisories/GHSA-5fpq-26gf-qwcrOSV / GitHub Security Advisories · advisory
- https://osv.dev/vulnerability/GHSA-5fpq-26gf-qwcrOSV / GitHub Security Advisories · osv
For agents and automation
Read public disclosures for free as Markdown or JSON. Compatible browsers also expose native WebMCP tools to search disclosures, read this page, and discover API access.
Use the ontology-linked Cyber API with x402 pay per request, or a Y2 Pro or Elite API key with the intel:cyber scope.
Endpoints and access details
https://api.y2.dev/api/v2/cyber/cveshttps://api.y2.dev/api/v2/cyber/cves/{cveId}
A workspace owner or admin can create a Pro or Elite API key. Send Authorization: Bearer <Y2_API_KEY> from your trusted agent runtime.
For x402, omit Authorization and read the HTTP 402 payment challenge before signing a retry. Public browser tools do not make payments.