Vulnerabilities in pkg:pypi/scrapy

PACKAGE
Advisory Identifier: GHSA-cjvr-mfj7-j4j8
Advisory Summary

CVE-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.

12 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/scrapy

12 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/scrapy. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-cjvr-mfj7-j4j8 CVE-2022-0577 MODERATE Incorrect Authorization and Exposure of Sensitive Information to an Unauthorized Actor in scrapy
GHSA-76g3-c3x4-crvx CVE-2026-84366 HIGH Scrapy: S3DownloadHandler sends signed S3 requests over plaintext HTTP by default
GHSA-h7wm-ph43-c39p CVE-2017-14158 HIGH Scrapy denial of service vulnerability
GHSA-cc65-xxvf-f7r9 CVE-2024-1892 HIGH Scrapy vulnerable to ReDoS via XMLFeedSpider
GHSA-cg34-w3fm-82h3 - HIGH Duplicate Advisory: Scrapy leaks the authorization header on same-domain but cross-origin redirects
GHSA-7c9g-vj9m-8pm6 - HIGH Duplicate Advisory: ReDos vulnerability of XMLFeedSpider
GHSA-cw9j-q3vf-hrrv CVE-2024-3574 HIGH Scrapy authorization header leakage on cross-domain redirect
GHSA-4q82-j5c2-g2c5 - HIGH Duplicate Advisory: Scrapy authorization header leakage on cross-domain redirect
GHSA-7j7m-v7m3-jqm7 CVE-2024-3572 HIGH Scrapy decompression bomb vulnerability
GHSA-rmqv-7v3j-mr7p - HIGH Duplicate Advisory: Scrapy decompression bomb vulnerability
GHSA-9x8m-2xpf-crp3 - MODERATE Scrapy before 2.6.2 and 1.8.3 vulnerable to one proxy sending credentials to another
GHSA-mfjm-vh54-3f96 - MODERATE Scrapy cookie-setting is not restricted based on the public suffix list

CVE-2022-0577 at a Glance

CVE Identifier CVE-2022-0577
GHSA Identifier GHSA-cjvr-mfj7-j4j8
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Scrapy
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

scrapy fixed: 2.6.0
pip install scrapy>=2.6.0
scrapy fixed: 1.8.2
pip install scrapy>=1.8.2
Verify Direct and Transitive Dependencies

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

### Impact If 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. ### Patches Upgrade 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². If 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. ¹ 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. ² This prevents cookie leaks to unintended domains even if the cookies middleware is not used. ### Workarounds If 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. Alternatively, 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. ### References * Originally reported at [huntr.dev](https://huntr.dev/bounties/3da527b1-2348-4f69-9e88-2e11a96ac585/) ### For more information If you have any questions or comments about this advisory: * [Open an issue](https://github.com/scrapy/scrapy/issues) * [Email us](mailto:opensource@zyte.com)

CVE-2022-0577 Affected Scrapy Versions

2 component(s)
Fixed Versions:
2.6.01.8.2
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?
CVE-2022-0577 is a security vulnerability in Scrapy involving Incorrect Authorization and Exposure of Sensitive Information to an Unauthorized Actor in scrapy under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Scrapy versions are affected?
Affected versions include releases prior to 2.6.0, 1.8.2 across affected packages: scrapy.
What version fixes CVE-2022-0577?
Upgrading to 2.6.0, 1.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is scrapy affected?
Yes, scrapy is affected in releases prior to 2.6.0, 1.8.2. Upgrade your dependency to 2.6.0, 1.8.2 or later.
What is the CVSS score of CVE-2022-0577?
CVE-2022-0577 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-0577?
CVE-2022-0577 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check PyPI dependencies for CVE-2022-0577?
Run the dependency tree command: 'pip show scrapy'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}