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

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), Scrapy. Vendors: PyPI, 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
    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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.