Skip to main content

Happy DOM EUVDEUVD-2026-112468

| CVE-2026-118661 MEDIUM
Reliance on Cookies without Validation and Integrity Checking (CWE-565)
2026-10-28 GitHub_M GHSA-5fpq-26gf-qwcr
6.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    SSR/prerender app fetches attacker-controlled origin
  2. Delivery
    Attacker responds with Set-Cookie using forged Domain (unrelated host or public suffix)
  3. Exploit
    CookieContainer stores cookie without DNS-label boundary check
  4. Execution
    App makes request to victim origin
  5. Impact
    Forged cookie delivered, causing cookie injection / session fixation

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V3 - Web Frontend Security Cookie integrity validation
Exploitation Conditions

Requires that the application run happy-dom < 20.14.6 as a server-side rendering or prerendering engine that performs cookie handling via CookieContainer, AND that within the same Window/cookie container it first issues a request to an attacker-controlled origin and later a request to the victim origin. The attacker must be able to set an arbitrary Set-Cookie Domain attribute on their response (trivial for an attacker-controlled server). Key limiting factors: happy-dom is primarily a headless/test DOM, so there is no impact in test-only usage; exploitation depends on this specific cross-origin fetch sequence in an SSR/prerender pipeline, and delivery of the forged cookie to the victim request is what grants the injection/session-fixation effect. No authentication on the victim origin is needed for the cookie to be planted and delivered.

Impact

This is a medium-severity cookie-scoping flaw (CVSS 6.5, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N) whose real-world priority is strongly gated by deployment context rather than raw score. Positive exploitation signals: a full, working proof-of-concept is published in the vendor GHSA advisory (with verbatim observed output confirming the endsWith/no-DNS-label-boundary bug and public-suffix acceptance), and the vuln.today decision label is 'this_month' - meaningful but below act_now/emergency. Tempering signals: it is NOT in CISA KEV (no confirmed active exploitation), and no EPSS probability was provided in the input, so the likelihood of widespread opportunistic exploitation cannot be quantified from available data. The dominant caveat - explicitly acknowledged by the reporter - is that happy-dom is primarily a headless/test DOM; the forgery only has security impact when happy-dom is used for server-side rendering or prerendering cookie handling in an application that contacts attacker-controlled origins and then a victim origin. In pure test usage the real risk is negligible. Net: a genuine but conditional issue - treat as a prompt dependency update for SSR/prerender deployments, not a drop-everything emergency.

Exploit ScenarioDerived

An SSR or prerender service built on happy-dom (< 20.14.6) loads or scrapes an attacker-controlled page; the attacker's server responds with a Set-Cookie carrying a Domain attribute for an unrelated host or a public suffix (e.g. Domain=localhost from 127.0.0.1, or Domain=com). Because CookieContainer does not enforce a DNS-label boundary and does not reject public suffixes, happy-dom stores the mis-scoped cookie, and when the service subsequently fetches the victim origin the forged cookie is attached - enabling cookie injection or session fixation. A working PoC demonstrating this exact chain is published in the GHSA advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 28, 2026

Cookie scope forgery in Happy DOM 20.14.5 and earlier lets an attacker-controlled origin plant a cookie that a victim origin subsequently receives, enabling cookie injection and session fixation in server-side rendering or prerendering pipelines that use the library's CookieContainer for cookie handling. The flaw is only reachable when the same Window/cookie container first fetches an attacker-controlled origin and then a request to the victim origin, so test-only usage of the headless DOM carries no impact; the assessed vector is AV:N/AC:H with low confidentiality and integrity impact. It is fixed in 20.14.6, a public PoC reference exists (it is not verified as working exploit code), no CISA KEV listing or active exploitation is indicated, and the priority is a normal monthly patch cycle rather than emergency response.

RemediationAI

Vendor-released patch: upgrade happy-dom to 20.14.6 or later (npm install happy-dom@20.14.6), which enforces domain validation against the setting origin and public-suffix checks; the fix is in PR https://github.com/capricorn86/happy-dom/pull/2477 and commit https://github.com/capricorn86/happy-dom/commit/f21dbd7d0a0c63cdd41954ba5d0f05def4e0f2b3, with advisory https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr. If immediate upgrade is not possible, reduce exposure by not sharing a single Window or CookieContainer between untrusted and trusted origins, by restricting SSR/prerender outbound fetches to an allowlist of trusted hosts, and by not using happy-dom's CookieContainer to hold real production session cookies; each of these reduces reachability of the cross-origin plant-then-deliver sequence but does not enforce browser-equivalent cookie scoping, which only the 20.14.6 update provides. Given the this_month priority, remediation can be scheduled in the normal monthly patch cycle rather than as an emergency change.

Affected VersionsENISA

happy-dom < 20.14.6

Affected Packages

npm happy-dom fix: 20.14.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Happy DOM is a JavaScript implementation of a web browser without a graphical user interface, commonly used for testing but also for server-side rendering and prerendering. The affected component is CookieContainer in src/cookie/CookieContainer.ts, which stores cookies and decides whether a stored cookie should be sent with a given request. Per RFC 6265, a Domain attribute must be validated against the setting origin's host and must be a domain-match on a DNS-label boundary, and public suffixes must not be accepted as cookie domains. The implementation instead accepted a Domain unrelated to the setting origin and treated an unrelated suffix-sharing hostname as a match because cookieMatchesURL used a plain suffix comparison (for example 'notexample.com'.endsWith('example.com') evaluates true, and 'example.com' ends with 'com'). This is CWE-565, reliance on cookies without validation and integrity checking: the library trusts attacker-supplied Domain values instead of enforcing browser cookie scoping, so trust boundaries between origins inside one Window collapse. The upstream fix adds CookieDomainUtility.validateDomain, bundles a PublicSuffixList generated from publicsuffix.org, applies domain validation in CookieContainer and in CookieStore.set (rejecting leading-dot and non-matching domains), and clones the origin URL so cookie scope survives navigation. The assessed CVSS is AC:H rather than AC:L because exploitation requires a specific sequence - an application contacting an attacker-controlled origin and then the victim origin within the same cookie container - rather than a single request.

Know when Happy Dom gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
vuln.today AI 4.8 MEDIUM

AC:H because impact requires the specific SSR flow (app fetches attacker origin then victim origin) outside the attacker's direct control; PR:N/UI:N as no victim credentials or interaction are needed; C:L/I:L for cookie injection/session fixation, A:N.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

1
Patch available
Oct 28, 2026 - 21:19 EUVD

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 819 npm packages depend on happy-dom (199 direct, 630 indirect)

Ecosystem-wide dependent count for version 20.14.6.

Threat Intelligence Overview

Prevalence
Medium
popular npm DOM library, but production SSR cookie use is narrower
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy