CVE-2023-45143
JSON

3.9low

Undici's cookie header not cleared on cross-origin redirect in fetch

Severity
3.9low CVSS:3.1 by GitHub_M
Exploit likelihood
1.37% (higher than 72% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-wqq4-5wpv-mx2g

Description

Undici is an HTTP/1.1 client written from scratch for Node.js. Prior to version 5.26.2, 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 third-party site or a malicious attacker who can control the redirection target (ie. an open redirector) to leak the cookie to the third party site. This was patched in version 5.26.2. There are no known workarounds.

Affected

Product or packageVersionsReported by
nodejs undici< 5.26.2, before 5.26.2CVE List, NVD
undici (npm)before 5.26.2GitHub Advisory Database
fedoraproject fedora37, 38, 39NVD

All scores

GitHub_M3.9low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L
GitHub3.9low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L
NVD3.5low CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N

Classification

CWE-200

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Undici is an HTTP/1.1 client written from scratch for Node.js. Prior to version 5.26.2, 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 third-party site or a malicious attacker who can control the redirection target (ie. an open redirector) to leak the cookie to the third party site. This was patched in version 5.26.2. There are no known workarounds.

GitHub Advisory Database
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.

NVD (es)

Undici es un cliente HTTP/1.1 escrito desde cero para Node.js. Antes de la versión 5.26.2, Undici ya borraba los encabezados de Autorización en redireccionamientos entre orígenes, pero no borraba los encabezados de "Cookie". Por diseño, los encabezados de "cookie" son encabezados de solicitud prohibidos, lo que no permite que se establezcan en RequestInit.headers en entornos de navegador. Dado que undici maneja los encabezados de manera más liberal que la especificación, hubo una desconexión con las suposiciones que hizo la especificación y la implementación de fetch por parte de undici. Como tal, esto puede provocar una fuga accidental de cookies a un sitio de terceros o que un atacante malicioso que pueda controlar el objetivo de la redirección (es decir, un redirector abierto) filtre la cookie al sitio de terceros. Esto fue parcheado en la versión 5.26.2. No se conocen workarounds.

References

https://github.com/nodejs/undici/security/advisories/GHSA-wqq4-5wpv-mx2gvendor-advisory, web
https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qpnot-applicable, web
https://github.com/nodejs/undici/commit/e041de359221ebeae04c469e8aff4145764e6d76patch, web
https://hackerone.com/reports/2166948permissions-required, web
https://github.com/nodejs/undici/releases/tag/v5.26.2release-notes, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/E72T67UPDRXHIDLO3OROR25YAMN4GGW5/mailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/X6QXN4ORIVF6XBW4WWFE7VNPVC74S45Y/mailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LKYHSZQFDNR7RSA7LHVLLIAQMVYCUGBG/mailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FNA62Q767CFAFHBCDKYNPBMZWB7TWYVU/mailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3N4NJ7FR4X4FPZUGNTQAPSTVB2HB2Y4A/mailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HT7T2R4MQKLIF4ODV4BDLPARWFPCJ5CZ/mailing-list, third-party-advisory
https://nvd.nist.gov/vuln/detail/CVE-2023-45143advisory

Sources

SourceRecordLicence
CVE ListCVE-2023-45143 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-wqq4-5wpv-mx2g changed 2026-02-04CC-BY-4.0
NVDCVE-2023-45143 changed 2026-06-17Public domain