Uncleared cookies on cross-host/cross-origin redirect in undici
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Spoofing, Security bypass
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-601 and CWE-346.
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).
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| NodeJS | undici | before 5.7.1 | 5.7.1 | Patch available | CNA |
| — | undici (npm) | before 5.8.0 | 5.8.0 | Patch available | GHSA-q768-x9m6-m9qp |
- undici VendorNodeJS Affected before 5.7.1 Fixed in 5.7.1 Patch available CNA
- undici (npm) Vendor— Affected before 5.8.0 Fixed in 5.8.0 Patch available GHSA-q768-x9m6-m9qp
Remediation
- Fix · CNA undici (nodejs) Fixed in 5.7.1
- Fix · GHSA-q768-x9m6-m9qp undici (npm) Fixed in 5.8.0 Advisory →
Red Hat 1 advisory
- RHSA-2022:6696 Released 2022-09-26 · Red Hat rating CriticalRed Hat Advanced Cluster Management 2.4.6 security update and bug fixes
- Red Hat Advanced Cluster Management for Kubernetes 2.4 for RHEL 8 rhacm2/acm-grafana-rhel8, rhacm2/acm-must-gather-rhel8, rhacm2/acm-operator-bundle +47
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Advanced Cluster Management for Kubernetes 2 | Affected | No fix yet |
Not affected: 1 product
- Red Hat OpenShift Dev Spaces
Timeline
- 2026-10-02 Threatist record created from CVE-2022-31151
- 2026-10-03 Alias added: GHSA-q768-x9m6-m9qp
References
Advisory 4
Other 6
- 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
More NodeJS Undici vulnerabilities
- TI-2026-01215 undici is vulnerable to Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') CVSS 3.1CRITICAL 9.8
- TI-2022-16376 `undici.request` vulnerable to SSRF using absolute URL on `pathname` CVSS 3.1CRITICAL 9.8
- TI-2023-09734 CRLF Injection in Nodejs ‘undici’ via host CVSS 3.1MEDIUM 6.5
- TI-2022-13193 CRLF injection in request headers CVSS 3.1MEDIUM 6.5
- TI-2022-16375 CRLF Injection in Nodejs ‘undici’ via Content-Type CVSS 3.1MEDIUM 5.3
- TI-2024-20007 Undici's fetch with integrity option is too lax when algorithm is specified but hash value is in incorrect CVSS 3.1LOW 3.5
Sources
- CVE-2022-31151 · CVE Program
- CVE-2022-31151 · NVD
- FIRST EPSS
- GHSA-q768-x9m6-m9qp · GitHub Advisory Database · CC BY 4.0
- CVE-2022-31151 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences