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

- Priority: **Routine**
- Reason: Not severe (CVSS 3.7, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-07-20 · Modified: 2025-04-22
- Aliases: UBUNTU-CVE-2022-31151, DEBIAN-CVE-2022-31151, GHSA-q768-x9m6-m9qp
- Record: https://cvemate.com/vulnerability/CVE-2022-31151 · JSON: https://cvemate.com/vulnerability/CVE-2022-31151/json

## Description

```text
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).
```

## Signals

- CVSS: 6.5 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- EPSS: 0.739%, percentile 55.918%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected

- debian node-undici (Debian): \< 5.8.0+dfsg1+~cs18.9.16-1
- ubuntu node-undici (Ubuntu): All versions (No fix recorded)
- nodejs undici: \< 5.7.1
- Npm undici (Npm): \< 5.8.0

## References

- <https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp>
- <https://github.com/nodejs/undici/issues/872>
- <https://hackerone.com/reports/1635514>
- <https://security.netapp.com/advisory/ntap-20220909-0006/>
- <https://ubuntu.com/security/CVE-2022-31151>
- <https://www.cve.org/CVERecord?id=CVE-2022-31151>
- <https://security-tracker.debian.org/tracker/CVE-2022-31151>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31151>
- <https://github.com/nodejs/undici/pull/1441>
- <https://github.com/nodejs/undici/commit/0a5bee9465e627be36bac88edf7d9bbc9626126d>
- <https://github.com/nodejs/undici>
- <https://github.com/nodejs/undici/blob/main/lib/handler/redirect.js#L189>
- <https://github.com/nodejs/undici/releases/tag/v5.8.0>
- <https://security.netapp.com/advisory/ntap-20220909-0006>

---

Data as of 2026-12-05T08:40:58.894Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
