CVE-2024-1968: Authorization Header Leakage in scrapy/scrapy on Scheme Change Redirects

Published May 14, 2024
·
Updated

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

Other sources

In scrapy/scrapy, an issue was identified where the Authorization header is not removed during redirects that only change the scheme (e.g., HTTPS to HTTP) but remain within the same domain. This behavior contravenes the Fetch standard, which mandates the removal of Authorization headers in cross-origin requests when the scheme, host, or port changes. Consequently, when a redirect downgrades from HTTPS to HTTP, the Authorization header may be inadvertently exposed in plaintext, leading to potential sensitive information disclosure to unauthorized actors. The flaw is located in the buildredirectrequest function of the redirect middleware.

NVD

Affected Software

3 affected componentsFixes available
pip/Scrapy<2.11.2
2.11.2
scrapy scrapy<=1.8.4
scrapy scrapy>=2.0.0<2.11.2

Event History

May 14, 2024
Advisory Published
via GitHub·08:14 PM
May 20, 2024
CVE Published
via MITRE·08:03 AM
Data Sourced
via MITRE·08:03 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 AM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-1968?

CVE-2024-1968 is considered a significant vulnerability due to the potential exposure of sensitive `Authorization` headers during domain redirections.

2

How do I fix CVE-2024-1968?

To fix CVE-2024-1968, upgrade Scrapy to version 2.11.2 or later.

3

What versions of Scrapy are affected by CVE-2024-1968?

Scrapy versions before 2.11.2 are affected by CVE-2024-1968.

4

What does CVE-2024-1968 affect in Scrapy?

CVE-2024-1968 affects the handling of the `Authorization` header during HTTP redirections in Scrapy.

5

Is CVE-2024-1968 a remote code execution vulnerability?

CVE-2024-1968 is not a remote code execution vulnerability; it relates to the improper handling of HTTP headers.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203