CVE-2026-105782 Scrapy: Arbitrary Module Import via Referrer-Policy Header in RefererMiddleware
A malicious website can cause arbitrary module import and execution via the Referrer-Policy header in Scrapy, leading to denial of service or code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-105782?
CVE-2026-105782 is a high-severity code injection vulnerability in scrapy, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Scrapy is a high-level web crawling and scraping framework for Python. From 1.4.0 until 2.14.2, RefererMiddleware in scrapy/spidermiddlewares/referer.py treated a Referrer-Policy response-header value that resembled a Python import path as a referrer policy class, imported the referenced object, and called it. A malicious website could supply a callable such as sys.exit and terminate a crawler processing the response. This issue is fixed in version 2.14.2.
Weakness: CWE-470
Which versions are affected by CVE-2026-105782?
3 open source packages ship an affected version, including scrapy and Scrapy.
| Package | Affected | Fixed in |
|---|---|---|
scrapy PyPI | From 1.4.0 | 2.14.2 |
scrapy PyPI | From 1.4.0 | 2.14.2 |
Scrapy PyPI | From 1.4.0 | 2.14.2 |
How do I fix CVE-2026-105782?
Upgrade scrapy to 2.14.2 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-105782 being exploited?
There is no known exploitation of CVE-2026-105782 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2026-105782, GHSA-cwxj-rr6w-m6w7, PYSEC-2026-4299, UBUNTU-CVE-2026-105782.