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

- Severity: Low 3.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.74%, higher than 55% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-07-20T23:00:15.000Z
- Modified: 2026-06-17T04:44:54.663Z
- Also known as: GHSA-q768-x9m6-m9qp
- Related: CVE-2023-45143
- Weaknesses: CWE-93, CWE-346, CWE-601
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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).

(As written by CVE List.)

## Affected

- nodejs undici: < 5.7.1; before 5.7.1
- undici (npm): before 5.8.0

## Every score

- GitHub_M: CVSS:3.1 3.7 Low `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N`
- GitHub: CVSS:3.1 3.7 Low `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`

## 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)
- <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)
- <https://security.netapp.com/advisory/ntap-20220909-0006> (web)

## Sources

- CVE List: [CVE-2022-31151](https://www.cve.org/CVERecord?id=CVE-2022-31151), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-q768-x9m6-m9qp](https://github.com/advisories/GHSA-q768-x9m6-m9qp), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2022-31151](https://nvd.nist.gov/vuln/detail/CVE-2022-31151), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31151 · Whole record: https://cve.day/CVE-2022-31151.json · Rebuilt by cve.day 2026-11-25T22:58:13.130Z
