CVE-2022-31151
MEDIUM 6.5CVSS 3.1undici before v5.8.0 vulnerable to uncleared cookies on cross-host / cross-origin redirect
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).
- Published
- 21 Jul 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-346CWE-601CWE-93
- Also known as
- GHSA-q768-x9m6-m9qp
- Sources
- NVDJSONOSV GHSA-q768-x9m6-m9qpJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | LOW 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | LOW 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | nodejs | undicicpe:2.3:a:nodejs:undici:*:*:*:*:*:node.js:*:* |
< 5.7.1 | 5.7.1 |
| OSV | npm | undici | < 5.8.0 | 5.8.0 |
References
- https://github.com/nodejs/undici/issues/872 · Exploit, Issue Tracking, Third Party Advisory, WEB
- https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp · Third Party Advisory, WEB
- https://hackerone.com/reports/1635514 · Permissions Required, Third Party Advisory, WEB
- https://security.netapp.com/advisory/ntap-20220909-0006/ · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-31151 · ADVISORY
- https://github.com/nodejs/undici/pull/1441 · WEB
- https://github.com/nodejs/undici/commit/0a5bee9465e627be36bac88edf7d9bbc9626126d · WEB
- https://github.com/nodejs/undici · PACKAGE
- https://github.com/nodejs/undici/blob/main/lib/handler/redirect.js#L189 · WEB
- https://github.com/nodejs/undici/releases/tag/v5.8.0 · WEB
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 21 Jul 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 21 Jul 2022)