Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. undici
  4. ›
  5. CVE-2022-31151

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

July 21, 2022 (updated September 29, 2022)

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

References

  • github.com/advisories/GHSA-q768-x9m6-m9qp
  • github.com/nodejs/undici/blob/main/lib/handler/redirect.js
  • github.com/nodejs/undici/commit/0a5bee9465e627be36bac88edf7d9bbc9626126d
  • github.com/nodejs/undici/issues/872
  • github.com/nodejs/undici/pull/1441
  • github.com/nodejs/undici/releases/tag/v5.8.0
  • github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp
  • hackerone.com/reports/1635514
  • nvd.nist.gov/vuln/detail/CVE-2022-31151

Code Behaviors & Features

Detect and mitigate CVE-2022-31151 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.7.1

Fixed versions

  • 5.8.0

Solution

Upgrade to version 5.8.0 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-601: URL Redirection to Untrusted Site ('Open Redirect')

Source file

npm/undici/CVE-2022-31151.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:14 +0000.