`Cookie` HTTP header isn't stripped on cross-origin redirects
Published 2 Oct 2023 · Updated 10 Sept 2026
Is your project on an affected urllib3?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=2.0.0 <2.0.6
- Fixed in
- 2.0.6
pip install 'urllib3>=2.0.6'- Affected
- <1.26.17
- Fixed in
- 1.26.17
pip install 'urllib3>=1.26.17'Details
urllib3 doesn't treat the Cookie HTTP header special or provide any helpers for managing cookies over HTTP, that is the responsibility of the user. However, it is possible for a user to specify a Cookie header and unknowingly leak information via HTTP redirects to a different origin if that user doesn't disable redirects explicitly.
Users must handle redirects themselves instead of relying on urllib3's automatic redirects to achieve safe processing of the Cookie header, thus we decided to strip the header by default in order to further protect users who aren't using the correct approach.
Affected usages
We believe the number of usages affected by this advisory is low. It requires all of the following to be true to be exploited:
- Using an affected version of urllib3 (patched in v1.26.17 and v2.0.6)
- Using the
Cookieheader on requests, which is mostly typical for impersonating a browser. - Not disabling HTTP redirects
- Either not using HTTPS or for the origin server to redirect to a malicious origin.
Remediation
- Upgrading to at least urllib3 v1.26.17 or v2.0.6
- Disabling HTTP redirects using
redirects=Falsewhen sending requests. - Not using the
Cookieheader.
Is GHSA-v845-jxx5-vc9f in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected urllib3, and gives you the command that fixes it.
More advisories for urllib3
- MediumCVE-2026-97688urllib3: Chunked Deflate streaming can enter an infinite loop · 30 Sept 2026
- HighCVE-2026-97689urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory · 30 Sept 2026
- HighCVE-2026-97687urllib3: HTTPS proxy TLS configuration may be ignored or overridden · 30 Sept 2026
- HighCVE-2026-44432urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API · 11 May 2026
- HighCVE-2026-44431urllib3: Sensitive headers forwarded across origins in proxied low-level redirects · 11 May 2026
- HighCVE-2026-21441Decompression-bomb safeguards bypassed when following HTTP redirects (streaming API) · 7 Jan 2026
References
- Linkgithub.com/urllib3/urllib3/security/advisories/GHSA-v845-jxx5-vc9f
- Advisorynvd.nist.gov/vuln/detail/CVE-2023-43804
- Linkgithub.com/urllib3/urllib3/commit/01220354d389cd05474713f8c982d05c9b17aafb
- Linkgithub.com/urllib3/urllib3/commit/644124ecd0b6e417c527191f866daa05a5a2056d
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2023-192.yaml
- Packagegithub.com/urllib3/urllib3
- Linklists.debian.org/debian-lts-announce/2023/10/msg00012.html
- Linklists.debian.org/debian-lts-announce/2024/12/msg00020.html
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5F5CUBAN5XMEBVBZPHFITBLMJV5FIJJ5
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/I3PR7C6RJ6JUBQKIJ644DMIJSUP36VDY
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NDAGZXYJ7H2G3SB47M453VQVNAWKAEJJ
- Linksecurity.netapp.com/advisory/ntap-20241213-0007
- Linkwww.vicarius.io/vsociety/posts/cve-2023-43804-urllib3-vulnerability-3
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.