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

Low 3.9 Published Updated

Undici fails to clear Cookie headers on cross-origin redirects, potentially leaking sensitive cookies to third-party sites or attackers controlling redirect targets.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-45143?

CVE-2023-45143 is a low-severity vulnerability in Fedoraproject Fedora, published on 12 Oct 2023. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-200

Which versions are affected by CVE-2023-45143?

2 open source packages ship an affected version, including undici. It affects 2 products.

PackageAffectedFixed in
undici npmAll versions5.26.2
undici npmAll versions5.26.2

Products include Fedoraproject Fedora, Nodejs Undici.

How do I fix CVE-2023-45143?

Upgrade undici to 5.26.2 or later.

Is CVE-2023-45143 being exploited?

There is no known exploitation of CVE-2023-45143 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as ALPINE-CVE-2023-45143, AZL-31338, CLEANSTART-2026-QW98383, CLEANSTART-2026-TM79261, CLEANSTART-2026-ZI83598, CLSA-2026-1775220180 and 3 more.

Is CVE-2023-45143 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free