# Scrapy insecure redirect handling in non-HTTP protocols

Source: https://junglewise.ai/threats/scrapy-insecure-redirect-handling-in-non-http-protocols-13c14788  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-05-14. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2024-05-14

Scrapy, a popular web scraping framework, incorrectly follows HTTP redirects for non-HTTP protocols like file://, ftp://, and s3://. An attacker with the ability to control a spider's start URLs could exploit this to redirect requests to local files, malicious FTP servers, or cloud storage, potentially exposing sensitive credentials or local data that the spider processes.

Technologies: [scrapy (PyPI)](https://junglewise.ai/threats/technologies/scrapy). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 14 May 2024.

**Which products and versions are affected?** scrapy (PyPI) ECOSYSTEM:introduced=0,fixed=2.11.2.

**Is there a fix for This vulnerability?** Yes. scrapy (PyPI): upgrade to 2.11.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run scrapy (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- scrapy (PyPI): upgrade to 2.11.2 or later

  ```sh
  pip install "scrapy>=2.11.2"
  ```


## Technical details

Scrapy's redirect middleware (RedirectMiddleware and MetaRefreshMiddleware) follows HTTP redirects indiscriminately across all URL protocols (file://, ftp://, s3://, data://, etc.) instead of restricting them to http:// and https:// schemes. An attacker with write access to spider start_urls and read access to spider output can chain redirects to exfiltrate sensitive data: file:// redirects expose local files, ftp:// redirects can capture FTP credentials, and s3:// redirects can access cloud storage using configured S3 credentials. The vulnerability is network-reachable and requires low privilege (ability to define start URLs). The fix, available in Scrapy 2.11.2, restricts redirect following to HTTP/HTTPS only.

## Affected products

- Scrapy Scrapy < 2.11.2

## Timeline

- 2024-05-14: disclosed
- 2024-05-14: patched: Fixed in Scrapy 2.11.2

## References

- [https://github.com/scrapy/scrapy/security/advisories/GHSA-23j4-mw76-5v7h](https://github.com/scrapy/scrapy/security/advisories/GHSA-23j4-mw76-5v7h)
- [https://github.com/scrapy/scrapy/issues/457](https://github.com/scrapy/scrapy/issues/457)

## Related threats

- [Scrapy arbitrary code execution via Referrer-Policy header](https://junglewise.ai/threats/cve-2026-105782-scrapy-arbitrary-module-import-via-referrer-policy-header-in)
- [Scrapy S3DownloadHandler cleartext transmission of AWS credentials](https://junglewise.ai/threats/cve-2026-84366-scrapy-s3downloadhandler-cleartext-transmission-of-aws)
- [PYSEC-2026-2401 - Scrapy is vulnerable to a denial of service (DoS) attack due to flaws in brotli decompression implementation](https://junglewise.ai/threats/cve-2025-6176-scrapy-denial-of-service-via-brotli-decompression-bomb)
- [PYSEC-2026-1907 - Scrapy decompression bomb vulnerability](https://junglewise.ai/threats/cve-2024-3572-scrapy-decompression-bomb-vulnerability)
- [PYSEC-2026-1908 - Scrapy authorization header leakage on cross-domain redirect](https://junglewise.ai/threats/cve-2024-3574-scrapy-authorization-header-leakage-on-cross-domain-redirect)
