CVE-2024-1968: Scrapy leaks the authorization header on same-domain but cross-origin redirects
Impact Since version 2.11.1, Scrapy drops the Authorization header when a request is redirected to a different domain. However, it keeps the header if the domain remains the same but the scheme (http/https) or the port change, all scenarios where the header should also be dropped.
Published May 14, 2024 · Updated May 20, 2024
Affected packages
Scrapy
- Ecosystem
- PyPI
- Affected
- < 2.11.2
- Fixed in
- 2.11.2
- Check
pip show Scrapy
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
Since version 2.11.1, Scrapy drops the Authorization header when a request is redirected to a different domain. However, it keeps the header if the domain remains the same but the scheme (http/https) or the port change, all scenarios where the header should also be dropped.
In the context of a man-in-the-middle attack, this could be used to get access to the value of that Authorization header
Patches
Upgrade to Scrapy 2.11.2.
Workarounds
There is no easy workaround for unpatched versions of Scrapy. You can replace the built-in redirect middlewares with custom ones patched for this issue, but you have to patch them yourself, manually.
References
This security issue was reported and fixed by @szarny at https://huntr.com/bounties/27f6a021-a891-446a-ada5-0226d619dd1a/.
Credited to Szarny.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-105782
Scrapy: Arbitrary Module Import via Referrer-Policy Header in RefererMiddleware
high7.5Mar 13, 2026CVE-2025-6176
Scrapy is vulnerable to a denial of service (DoS) attack due to flaws in brotli decompression implementation
high7.5Oct 31, 2025GHSA-23j4-mw76-5v7h
Scrapy allows redirect following in protocols other than HTTP
medium6.5May 14, 2024GHSA-jm3v-qxmh-hxwv
Scrapy's redirects ignoring scheme-specific proxy settings
medium4.3May 14, 2024
