Skip to content

Cookie header not cleared on cross-origin redirect in fetch

Low
mcollina published GHSA-wqq4-5wpv-mx2g Oct 12, 2023

Package

npm undici (npm)

Affected versions

< 5.26.2

Patched versions

>= v5.26.2

Description

Impact

Undici already cleared Authorization headers on cross-origin redirects, but did not clear Cookie headers. By design, cookie headers are forbidden request headers, disallowing them to be set in RequestInit.headers in browser environments. Since undici handles headers more liberally than the spec, there was a disconnect from the assumptions the spec made, and undici's implementation of fetch.

As such this may lead to accidental leakage of cookie to a 3rd-party site or a malicious attacker who can control the redirection target (ie. an open redirector) to leak the cookie to the 3rd party site.

Patches

This was patched in e041de359221ebeae04c469e8aff4145764e6d76.

Workarounds

There are no known workarounds.

References

Severity

Low
3.9
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L

CVE ID

CVE-2023-45143

Weaknesses

Credits