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

Status: published. Published: 2026-10-28. Updated: 2026-11-03.

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.

## Remediation

- fix: happy-dom (npm): OSV reports a fixed version 20.14.6. Check the advisory for supported release branches. (source: OSV GHSA-5fpq-26gf-qwcr) — https://github.com/advisories/GHSA-5fpq-26gf-qwcr

## Affected products and versions

- capricorn86 / happy-dom: < 20.14.6 (affected). Source: CNA: GitHub_M
-  / happy-dom (happy-dom): ≥ 0; < 20.14.6 (affected, semver); OSV events: introduced 0; fixed 20.14.6. Source: OSV GHSA-5fpq-26gf-qwcr

## Severity and prioritization

- CVSS 3.1: 6.5 (medium); CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N; source: CNA: GitHub_M

- CISA KEV: No listing in collected sources

- EPSS: 0.27% as of 2026-11-02; percentile 19.61%

- SSVC: exploitation poc; automatable yes; technical impact partial; source ADP: CISA-ADP

- Weaknesses: CWE-565

## Exploit evidence

- exploit: https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr (ADP: CISA-ADP)

## References

- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr (CNA: GitHub_M; x_refsource_CONFIRM)

- https://github.com/capricorn86/happy-dom/pull/2477 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/capricorn86/happy-dom/commit/f21dbd7d0a0c63cdd41954ba5d0f05def4e0f2b3 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/capricorn86/happy-dom/releases/tag/v20.14.6 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr (ADP: CISA-ADP; exploit)

- https://github.com/advisories/GHSA-5fpq-26gf-qwcr (OSV / GitHub Security Advisories; advisory)

- https://osv.dev/vulnerability/GHSA-5fpq-26gf-qwcr (OSV / GitHub Security Advisories; osv)

## Provenance

- CNA: GitHub_M: https://www.cve.org/CVERecord?id=CVE-2026-118661; retrieved 2026-11-03; source updated 2026-11-03

- OSV / GitHub Security Advisories: https://osv.dev/vulnerability/GHSA-5fpq-26gf-qwcr; retrieved 2026-11-03; source updated 2026-10-28

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-118661; retrieved 2026-11-03; source updated Not reported

Revision: 2ff8cd14683e67cb5631e55783067a890e69757c1b3d46ce8f04ea354d18bab4

Canonical: https://y2.dev/cve/CVE-2026-118661

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.