Happy DOM Cookie Leakage Vulnerability in Fetch Requests with Credentials

Vulnerability

A vulnerability in Happy DOM versions prior to 20.8.9 allows for the unintended leakage of cookies between different origins. When using the Fetch API with credentials included, the library may attach cookies from the current page origin instead of the intended request target URL. This flaw can result in cookies being sent from one origin to another, potentially leading to unauthorized access or data exposure.

Impact

Exploitation of this vulnerability causes cross-origin cookie leakage, where cookies from the page origin are incorrectly sent to the request target, violating expected cookie handling in cross-origin requests.

Reproduction

To reproduce this vulnerability, set a cookie on the page origin (e.g., 'page_cookie=PAGE_ONLY') and another cookie on the target origin (e.g., 'api_cookie=API_ONLY'). Then, make a fetch request from the page origin to the target origin with credentials included. The request will incorrectly include the page origin cookie instead of the target origin cookie, demonstrating the vulnerability.

Remediation

Users can upgrade to Happy DOM version 20.8.9 or later, where this vulnerability has been fixed.

Added: Mar 27, 2026, 10:22 PM
Updated: Mar 27, 2026, 10:22 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
2.5
exploitability
8.0
remediation
0.0
relevance
4.8
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.