CVE-2023-45143: Undici Undici's Cookie Header Not Cleared Vulnerability
LOWCVE-2023-45143 is a LOW (CVSS 3.9) undici's cookie header not cleared vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Undici libraries in the npm ecosystem. The issue involves undici's cookie header not cleared on cross-origin redirect in fetch. Remediation is available by upgrading affected packages to version 5.26.2.
CVE-2023-45143 at a Glance
Security Impact
CVSS: 3.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L).
How to Fix CVE-2023-45143
To remediate this vulnerability, upgrade all affected Undici dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install undici@5.26.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls undici
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-45143, inspect your project dependencies using npm:
npm ls undici
Analyze the terminal output to locate any version of Undici in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.26.2), your application is affected.
Note: The npm ls undici command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Undici, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-45143 Affected Undici Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
undici
|
npm |
< 5.26.2
|
5.26.2
|
References
Frequently Asked Questions
What is CVE-2023-45143?
Which Undici versions are affected?
What version fixes CVE-2023-45143?
Is undici affected?
What is the CVSS score of CVE-2023-45143?
What CWE is associated with CVE-2023-45143?
How can I check npm dependencies for CVE-2023-45143?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wqq4-5wpv-mx2g",
"modified" : "2024-02-16T22:37:23Z",
"published" : "2023-10-16T14:05:37Z",
"aliases" : [ "CVE-2023-45143" ],
"summary" : "Undici's cookie header not cleared on cross-origin redirect in fetch",
"details" : "### Impact\n\nUndici clears Authorization headers on cross-origin redirects, but does not clear `Cookie` headers. By design, `cookie` headers are [forbidden request headers](https://fetch.spec.whatwg.org/#forbidden-request-header), 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.\n\nAs 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.\n\n### Patches\n\nThis was patched in [e041de359221ebeae04c469e8aff4145764e6d76](https://github.com/nodejs/undici/commit/e041de359221ebeae04c469e8aff4145764e6d76), which is included in version 5.26.2.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "undici"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.26.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp"
}, {
"type" : "WEB",
"url" : "https://github.com/nodejs/undici/security/advisories/GHSA-wqq4-5wpv-mx2g"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45143"
}, {
"type" : "WEB",
"url" : "https://github.com/nodejs/undici/commit/e041de359221ebeae04c469e8aff4145764e6d76"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/2166948"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nodejs/undici"
}, {
"type" : "WEB",
"url" : "https://github.com/nodejs/undici/releases/tag/v5.26.2"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3N4NJ7FR4X4FPZUGNTQAPSTVB2HB2Y4A"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/E72T67UPDRXHIDLO3OROR25YAMN4GGW5"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FNA62Q767CFAFHBCDKYNPBMZWB7TWYVU"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HT7T2R4MQKLIF4ODV4BDLPARWFPCJ5CZ"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LKYHSZQFDNR7RSA7LHVLLIAQMVYCUGBG"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/X6QXN4ORIVF6XBW4WWFE7VNPVC74S45Y"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-16T14:05:37Z",
"nvd_published_at" : "2023-10-12T17:15:10Z"
}
}