Undici's cookie header not cleared on cross-origin redirect in fetch
Impact
Undici clears Authorization headers on cross-origin redirects, but does 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 specification, 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, which is included in version 5.26.2.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | undici | < 5.26.2 | 5.26.2 |
References
- https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp
- https://github.com/nodejs/undici/security/advisories/GHSA-wqq4-5wpv-mx2g
- https://nvd.nist.gov/vuln/detail/CVE-2023-45143
- https://github.com/nodejs/undici/commit/e041de359221ebeae04c469e8aff4145764e6d76
- https://hackerone.com/reports/2166948
- https://github.com/nodejs/undici
- https://github.com/nodejs/undici/releases/tag/v5.26.2
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3N4NJ7FR4X4FPZUGNTQAPSTVB2HB2Y4A
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/E72T67UPDRXHIDLO3OROR25YAMN4GGW5
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FNA62Q767CFAFHBCDKYNPBMZWB7TWYVU
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HT7T2R4MQKLIF4ODV4BDLPARWFPCJ5CZ
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LKYHSZQFDNR7RSA7LHVLLIAQMVYCUGBG
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/X6QXN4ORIVF6XBW4WWFE7VNPVC74S45Y
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L- Weakness (CWE)
CWE-200- Platform
- npm
- Package
undici- Disclosed
- 16.10.2023
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-wqq4-5wpv-mx2g - CC BY 4.0
Vulnerability history: undici
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 46
- First → latest
- 06.2022 09.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 13
- Medium 21
- Low 12
Disclosures per year
- 2022: 5
- 2023: 3
- 2024: 5
- 2025: 2
- 2026: 31
-
Undici's cookie header not cleared on cross-origin redirect in fetch this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.