CVE-2022-0577: Scrapy Incorrect Authorization And Exposure Of Vulnerability
MODERATECVE-2022-0577 is a MODERATE (CVSS 6.5) incorrect authorization and exposure of vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Scrapy libraries in the PyPI ecosystem. The issue involves incorrect authorization and exposure of sensitive information to an unauthorized actor in scrapy. Remediation is available by upgrading affected packages to version 2.6.0, 1.8.2.
CVE-2022-0577 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2022-0577
To remediate this vulnerability, upgrade all affected Scrapy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install scrapy>=2.6.0
pip install scrapy>=1.8.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show scrapy
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-0577, inspect your installed packages using pip:
pip show scrapy
Analyze the terminal output to locate any version of Scrapy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.0), your application is affected.
Note: The pip show scrapy command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Scrapy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-0577 Affected Scrapy Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
scrapy
|
PyPI |
≥ 2.0.0
< 2.6.0
|
2.6.0
|
|
scrapy
|
PyPI |
< 1.8.2
|
1.8.2
|
References
Frequently Asked Questions
What is CVE-2022-0577?
Which Scrapy versions are affected?
What version fixes CVE-2022-0577?
Is scrapy affected?
What is the CVSS score of CVE-2022-0577?
What CWE is associated with CVE-2022-0577?
How can I check PyPI dependencies for CVE-2022-0577?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cjvr-mfj7-j4j8",
"modified" : "2026-09-24T14:44:30Z",
"published" : "2022-03-01T22:12:47Z",
"aliases" : [ "CVE-2022-0577" ],
"summary" : "Incorrect Authorization and Exposure of Sensitive Information to an Unauthorized Actor in scrapy",
"details" : "### Impact\n\nIf you manually define cookies on a [`Request`](https://docs.scrapy.org/en/latest/topics/request-response.html#scrapy.http.Request) object, and that `Request` object gets a redirect response, the new `Request` object scheduled to follow the redirect keeps those user-defined cookies, regardless of the target domain.\n\n### Patches\n\nUpgrade to Scrapy 2.6.0, which resets cookies when creating `Request` objects to follow redirects¹, and drops the ``Cookie`` header if manually-defined if the redirect target URL domain name does not match the source URL domain name².\n\nIf you are using Scrapy 1.8 or a lower version, and upgrading to Scrapy 2.6.0 is not an option, you may upgrade to Scrapy 1.8.2 instead.\n\n¹ At that point the original, user-set cookies have been processed by the cookie middleware into the global or request-specific cookiejar, with their domain restricted to the domain of the original URL, so when the cookie middleware processes the new (redirect) request it will incorporate those cookies into the new request as long as the domain of the new request matches the domain of the original request.\n\n² This prevents cookie leaks to unintended domains even if the cookies middleware is not used.\n\n### Workarounds\n\nIf you cannot upgrade, set your cookies using a list of dictionaries instead of a single dictionary, as described in the [`Request` documentation](https://docs.scrapy.org/en/latest/topics/request-response.html#scrapy.http.Request), and set the right domain for each cookie.\n\nAlternatively, you can [disable cookies altogether](https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#std-setting-COOKIES_ENABLED), or [limit target domains](https://docs.scrapy.org/en/latest/topics/spiders.html#scrapy.spiders.Spider.allowed_domains) to domains that you trust with all your user-set cookies.\n\n### References\n* Originally reported at [huntr.dev](https://huntr.dev/bounties/3da527b1-2348-4f69-9e88-2e11a96ac585/)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* [Open an issue](https://github.com/scrapy/scrapy/issues)\n* [Email us](mailto:opensource@zyte.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "scrapy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.8.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "scrapy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/scrapy/scrapy/security/advisories/GHSA-cjvr-mfj7-j4j8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0577"
}, {
"type" : "WEB",
"url" : "https://github.com/scrapy/scrapy/commit/8ce01b3b76d4634f55067d6cfdf632ec70ba304a"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/scrapy/PYSEC-2022-159.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/scrapy/scrapy"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/3da527b1-2348-4f69-9e88-2e11a96ac585"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/03/msg00021.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200", "CWE-863" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-01T22:12:47Z",
"nvd_published_at" : null
}
}