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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-undici | 5.8.0+dfsg1+~cs18.9.16-1 | DEBIAN-CVE-2022-31151 |
| Debian:13 | node-undici | 5.8.0+dfsg1+~cs18.9.16-1 | DEBIAN-CVE-2022-31151 |
| Debian:14 | node-undici | 5.8.0+dfsg1+~cs18.9.16-1 | DEBIAN-CVE-2022-31151 |
| Ubuntu:24.04:LTS | node-undici | no fix listed | UBUNTU-CVE-2022-31151 |
| Ubuntu:25.10 | node-undici | no fix listed | UBUNTU-CVE-2022-31151 |
| Ubuntu:26.04:LTS | node-undici | no fix listed | UBUNTU-CVE-2022-31151 |
| Ubuntu:26.10 | node-undici | no fix listed | UBUNTU-CVE-2022-31151 |
| npm | undici | 5.8.0 | GHSA-q768-x9m6-m9qp |
Affected products (as reported)
Weakness: CWE-601 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
References
- https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp x_refsource_CONFIRM
- https://github.com/nodejs/undici/issues/872 x_refsource_MISC
- https://hackerone.com/reports/1635514 x_refsource_MISC
- https://security.netapp.com/advisory/ntap-20220909-0006/ x_refsource_CONFIRM