{"id":"CVE-2022-31151","aliases":["CVE-2022-31151","GHSA-q768-x9m6-m9qp"],"related":["CVE-2023-45143"],"kind":"vulnerability","state":"published","title":"Uncleared cookies on cross-host/cross-origin redirect in undici","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).","summarySource":"cvelist","descriptions":[{"lang":"en","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).","source":"cvelist"},{"lang":"en","text":"### Impact\n\nAuthorization headers are already cleared on cross-origin redirect in\nhttps://github.com/nodejs/undici/blob/main/lib/handler/redirect.js#L189, based on https://github.com/nodejs/undici/issues/872.\n\nHowever, 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.\nAs 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.\n\n### Patches\n\nThis was patched in v5.8.0.\n\n### Workarounds\n\nBy default, this vulnerability is not exploitable.\nDo not enable redirections, i.e. `maxRedirections: 0` (the default). \n\n### References\n\nhttps://hackerone.com/reports/1635514\nhttps://curl.se/docs/CVE-2018-1000007.html\nhttps://curl.se/docs/CVE-2022-27776.html\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [undici repository](https://github.com/nodejs/undici/issues)\n* To make a report, follow the [SECURITY](https://github.com/nodejs/node/blob/HEAD/SECURITY.md) document","format":"markdown","source":"ghsa"},{"lang":"es","text":"Los encabezados de autorización son borrados en las redirecciones de origen cruzado. Sin embargo, los encabezados de cookies, que son encabezados confidenciales y son encabezados oficiales que son encontrados en la especificación, permanecen sin limpiar. Se presentan usuarios activos que usan los encabezados de las cookies de forma indiscriminada. Esto puede conllevar a una fuga accidental de la cookie a un sitio de terceros o un atacante malicioso que pueda controlar el objetivo de la redirección (es decir, un redireccionador abierto) para filtrar la cookie al sitio de terceros. Esto fue parcheado en versión 5.7.1. Por defecto, esta vulnerabilidad no es explotable. No habilite los redireccionamientos, es decir, \"maxRedirections: 0\" (por defecto)","source":"nvd"}],"published":"2022-07-20T23:00:15.000Z","modified":"2026-06-17T04:44:54.663Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-93","CWE-346","CWE-601"],"affected":[{"ranges":[{"version":"< 5.7.1","status":"affected"}],"vendor":"nodejs","product":"undici","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.8.0"}],"ecosystem":"npm","package":"undici","purl":"pkg:npm/undici","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.7.1"}],"vendor":"nodejs","product":"undici","cpe":"cpe:2.3:a:nodejs:undici:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nodejs/undici/security/advisories/GHSA-q768-x9m6-m9qp","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nodejs/undici/issues/872","tags":["exploit","issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://hackerone.com/reports/1635514","tags":["permissions-required","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.netapp.com/advisory/ntap-20220909-0006/","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31151","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/pull/1441","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/commit/0a5bee9465e627be36bac88edf7d9bbc9626126d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/blob/main/lib/handler/redirect.js#L189","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/releases/tag/v5.8.0","tags":["web"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20220909-0006","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:45:24.308Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31151","url":"https://www.cve.org/CVERecord?id=CVE-2022-31151","licence":"CVE Terms of Use","modified":"2025-04-22T17:48:20.472Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q768-x9m6-m9qp","url":"https://github.com/advisories/GHSA-q768-x9m6-m9qp","licence":"CC-BY-4.0","modified":"2026-02-04T03:02:08.652Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31151","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31151","licence":"Public domain","modified":"2026-06-17T04:44:54.663Z"}],"updatedAt":"2026-11-25T22:58:13.130Z","epss":{"score":0.00739,"percentile":0.55771,"date":"2026-12-01T12:00:22.000Z"}}