# CVE-2026-105782: Scrapy arbitrary code execution via Referrer-Policy header

Source: https://junglewise.ai/threats/cve-2026-105782-scrapy-arbitrary-module-import-via-referrer-policy-header-in  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-06. Updated: 2026-10-06  
License: CC BY 4.0 with a link back

CVE-2026-105782 · Severity: high · CVSS 7.5 · Published 2026-10-06

Scrapy is a Python web crawling and scraping framework. An attacker controlling a web server can inject a malicious Referrer-Policy header that causes Scrapy to execute arbitrary Python code, potentially terminating the crawler or performing other malicious actions. This affects any Scrapy deployment that crawls untrusted websites.

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

## Quick answers

**Is CVE-2026-105782 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-105782 being exploited in the wild.

**How severe is CVE-2026-105782?** High severity, with a CVSS score of 7.5, published 6 October 2026.

**Which products and versions are affected?** scrapy (PyPI) >= 1.4.0, <= 2.14.1, ECOSYSTEM:introduced=1.4.0,fixed=2.14.2; Scrapy 1.4.0 through 2.14.1.

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

**How is CVE-2026-105782 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-105782?** Check whether you run scrapy (PyPI) or Scrapy 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.14.2 or later

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


## Technical details

RefererMiddleware in scrapy/spidermiddlewares/referer.py between versions 1.4.0 and 2.14.1 incorrectly parses the Referrer-Policy HTTP response header as a Python import path, dynamically imports the referenced object, and calls it as a function. An attacker can supply a header value resembling a Python module path (e.g., "sys.exit") to execute arbitrary code with the privileges of the crawler process. The fix restricts Referrer-Policy values to standard policy names rather than treating them as callable imports.

## Affected products

- Scrapy Scrapy 1.4.0 through 2.14.1

## Identifiers

- CVE-2026-105782
- GHSA-cwxj-rr6w-m6w7
- PYSEC-2026-4299

## Timeline

- 2026-10-06: disclosed
- 2026-01-19: patched: Fix committed to repository

## References

- [https://github.com/scrapy/scrapy/commit/945b787a263586cb5803c01c6da57daad8997ae5](https://github.com/scrapy/scrapy/commit/945b787a263586cb5803c01c6da57daad8997ae5)
- [https://github.com/scrapy/scrapy/commit/b6e5c58ae707a3d4bb491537b5519534050047e0](https://github.com/scrapy/scrapy/commit/b6e5c58ae707a3d4bb491537b5519534050047e0)

## Related threats

- [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)
- [Duplicate Advisory: Scrapy leaks the authorization header on same-domain but cross-origin redirects](https://junglewise.ai/threats/duplicate-advisory-scrapy-leaks-the-authorization-header-on-same-domain-8970f1ee)
