CVE-2022-31151 json
Uncleared cookies on cross-host/cross-origin redirect in undici
published 2022-07-20 4 y ago modified 2026-06-17 4 mo ago also GHSA-q768-x9m6-m9qp , EUVD-2022-6396
- cvss
- 3.7
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 54%
- public exploits
- 0
- none known
Summary
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).
Patch / fix
- npm undici 5.8.0
- nodejs undici 5.7.1
- node-undici Debian 14, Debian 13, Debian 12 5.8.0+dfsg1+~cs18.9.16-1
debian advisories DEBIAN-CVE-2022-31151
- github.com/nodejs/undici@0a5bee9 commit
- github.com/nodejs/undici#1441 pull request
- github.com/nodejs/undici/releases/tag/v5.8.0 release
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-31151 updated cvss 3.7
nodejs/undici: Cookie headers uncleared on cross-origin redirect
-
Red Hat Advanced Cluster Management for Kubernetes 2 rhacm2/search-ui-rhel8affected: workaround, no fix available “By default, this vulnerability is not exploitable. In order to make sure this is mitigated, do not enable redirections, i.e.: `maxRedirections: 0`”
-
Red Hat OpenShift Dev Spaces devspaces/dashboard-rhel8not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- 18 mo ago
Exploit prediction
0.74% chance of exploitation in the next 30 days, higher than 54% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/nodejs/undici/issues/872 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
| GitHub | 3.1 | 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | undici | <5.8.0 |
5.8.0 |
Affected products
- nodejs undici
Classification
References
-
github.com
/nodejs/undici/pull/1441
web
-
github.com
/nodejs/undici/commit/0a5bee9465e627be36bac88edf7d9bbc9626126d
web
-
github.com
/nodejs/undici/issues/872
web, exploit, issue-tracking, third-party-advisory
-
github.com
/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp
web, third-party-advisory
-
hackerone.com
/reports/1635514
web, permissions-required, third-party-advisory
-
security.netapp.com
/advisory/ntap-20220909-0006/
third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-31151
advisory
-
github.com
/nodejs/undici
package
-
github.com
/nodejs/undici/blob/main/lib/handler/redirect.js#L189
web
-
github.com
/nodejs/undici/releases/tag/v5.8.0
web
-
security.netapp.com
/advisory/ntap-20220909-0006
web
Sources
- CVE List CVE-2022-31151
- GitHub Advisory GHSA-q768-x9m6-m9qp
- NVD CVE-2022-31151
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.