CVE-2022-31151
Uncleared cookies on cross-host/cross-origin redirect in undici
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).
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
3.7
Uncleared cookies on cross-host/cross-origin redirect in undici
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).
- Record
CVE-2022-31151- 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 - Weakness
- CWE-601
- Updated
- 2026-11-02
EUVDEUVD-2022-6396
3.7
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).
- Record
EUVD-2022-6396- 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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-q768-x9m6-m9qp
3.7
undici before v5.8.0 vulnerable to uncleared cookies on cross-host / cross-origin redirect
Impact
Authorization headers are already cleared on cross-origin redirect in https://github.com/nodejs/undici/blob/main/lib/handler/redirect.js#L189, based on https://github.com/nodejs/undici/issues/872.
However, cookie headers which are sensitive headers and are official headers found in the spec, remain uncleared. There also has been active discussion of implementing a cookie store https://github.com/nodejs/undici/pull/1441, which suggests that there are active users using cookie headers in undici. As such 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.
Patches
This was patched in v5.8.0.
Workarounds
By default, this vulnerability is not exploitable.
Do not enable redirections, i.e. maxRedirections: 0 (the default).
References
https://hackerone.com/reports/1635514 https://curl.se/docs/CVE-2018-1000007.html https://curl.se/docs/CVE-2022-27776.html
For more information
If you have any questions or comments about this advisory:
- Open an issue in undici repository
- To make a report, follow the SECURITY document
- Record
GHSA-q768-x9m6-m9qp- 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 - Weakness
- CWE-93, CWE-346, CWE-601
- Updated
- 2026-11-02
NVD
3.7
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).
- Record
CVE-2022-31151- 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 - 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 - Weakness
- CWE-601, CWE-346
- Updated
- 2026-11-02
OSV
3.7
Uncleared cookies on cross-host/cross-origin redirect in undici
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).
- Record
CVE-2022-31151- 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 - Weakness
- CWE-601
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2022-31151
6.5
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).
- Record
DEBIAN-CVE-2022-31151- 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 - Updated
- 2026-11-03
OSVGHSA-q768-x9m6-m9qp
3.7
undici before v5.8.0 vulnerable to uncleared cookies on cross-host / cross-origin redirect
Impact
Authorization headers are already cleared on cross-origin redirect in https://github.com/nodejs/undici/blob/main/lib/handler/redirect.js#L189, based on https://github.com/nodejs/undici/issues/872.
However, cookie headers which are sensitive headers and are official headers found in the spec, remain uncleared. There also has been active discussion of implementing a cookie store https://github.com/nodejs/undici/pull/1441, which suggests that there are active users using cookie headers in undici. As such 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.
Patches
This was patched in v5.8.0.
Workarounds
By default, this vulnerability is not exploitable.
Do not enable redirections, i.e. maxRedirections: 0 (the default).
References
https://hackerone.com/reports/1635514 https://curl.se/docs/CVE-2018-1000007.html https://curl.se/docs/CVE-2022-27776.html
For more information
If you have any questions or comments about this advisory:
- Open an issue in undici repository
- To make a report, follow the SECURITY document
- Record
GHSA-q768-x9m6-m9qp- 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 - Weakness
- CWE-346, CWE-601, CWE-93
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2022-31151
3.7
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).
- Record
UBUNTU-CVE-2022-31151- 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 - 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 - Updated
- 2026-11-02
OSVCLSA-2026-1788560495 No score
TuxCare security update for undici (14 CVEs)
TuxCare rebuilt undici to address 14 CVEs. Fixed in 5.5.1-tuxcare.1.
- Record
CLSA-2026-1788560495- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
undicinpm |
before 5.8.0 | 5.8.0 |
undiciTuxCare:npm From an advisory covering 14 CVEs |
5.5.1-tuxcare.0 up to 5.5.1-tuxcare.1, plus listed versions 5.5.1 |
5.5.1-tuxcare.1 |
node-undiciDebian:12 |
before 5.8.0+dfsg1+~cs18.9.16-1 | 5.8.0+dfsg1+~cs18.9.16-1 |
node-undiciDebian:13 |
before 5.8.0+dfsg1+~cs18.9.16-1 | 5.8.0+dfsg1+~cs18.9.16-1 |
node-undiciDebian:14 |
before 5.8.0+dfsg1+~cs18.9.16-1 | 5.8.0+dfsg1+~cs18.9.16-1 |
node-undiciUbuntu:24.04:LTS |
All versions, plus listed versions 5.22.1+dfsg1+~cs20.10.10.2-1ubuntu15.26.3+dfsg1+~cs23.10.12-2 |
None known |
node-undiciUbuntu:25.10 |
All versions, plus listed versions 7.3.0+dfsg1+~cs24.12.11-17.3.0+dfsg1+~cs24.12.11-2 |
None known |
node-undiciUbuntu:26.10 |
All versions, plus listed versions 7.18.2+dfsg+~cs3.2.0-1build17.24.6+dfsg+~cs3.2.0-38.5.0+dfsg+~cs3.2.0-28.5.0+dfsg+~cs3.2.0-38.9.0+dfsg+~cs3.2.0-1 |
None known |
node-undiciUbuntu:26.04:LTS |
All versions, plus listed versions 7.3.0+dfsg1+~cs24.12.11-27.16.0+dfsg+~cs3.2.0-27.18.2+dfsg+~cs3.2.0-17.18.2+dfsg+~cs3.2.0-1build1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-31151 is a low vulnerability (CVSS 3.7) in Nodejs Undici, published July 20, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.74%, the 54th percentile. Fixed in undici 5.8.0.
References
github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp
github.com/nodejs/undici/issues/872
hackerone.com/reports/1635514
security.netapp.com/advisory/ntap-20220909-0006
nvd.nist.gov/vuln/detail/CVE-2022-31151
github.com/nodejs/undici/pull/1441
Show 9 moreShow less
github.com/nodejs/undici/commit/0a5bee9465e627be36bac88edf7d9bbc9626126d
github.com/nodejs/undici/blob/main/lib/handler/redirect.js
github.com/nodejs/undici/releases/tag/v5.8.0
github.com/advisories/GHSA-q768-x9m6-m9qp
github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31151.json
security-tracker.debian.org/tracker/CVE-2022-31151
github.com/nodejs/undici
ubuntu.com/security/CVE-2022-31151
cve.org/CVERecord?id=CVE-2022-31151