Vulnerability · Published Jul 20, 2022 · Assigned by GitHub_M

CVE-2022-31151Uncleared cookies on cross-host/cross-origin redirect in undici

Low 3.7

In plain English

A low-severity open redirect in undici from nodejs. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 55% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)3.7Low
Exploit odds (30 days)0.7%top 45.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

Authorization headers are cleared on cross-origin redirect. However, cookie headers which are sensitive headers and are official headers found in the spec, remain uncleared. There are active users using cookie headers in undici. 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. This was patched in v5.7.1. By default, this vulnerability is not exploitable. Do not enable redirections, i.e. `maxRedirections: 0` (the default).

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12node-undici5.8.0+dfsg1+~cs18.9.16-1DEBIAN-CVE-2022-31151
Debian:13node-undici5.8.0+dfsg1+~cs18.9.16-1DEBIAN-CVE-2022-31151
Debian:14node-undici5.8.0+dfsg1+~cs18.9.16-1DEBIAN-CVE-2022-31151
Ubuntu:24.04:LTSnode-undicino fix listedUBUNTU-CVE-2022-31151
Ubuntu:25.10node-undicino fix listedUBUNTU-CVE-2022-31151
Ubuntu:26.04:LTSnode-undicino fix listedUBUNTU-CVE-2022-31151
Ubuntu:26.10node-undicino fix listedUBUNTU-CVE-2022-31151
npmundici5.8.0GHSA-q768-x9m6-m9qp

Affected products (as reported)

VendorProductVersions
nodejs undici < 5.7.1

Weakness: CWE-601 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

References