CVE-2024-1968: Scrapy Scrapy Leaks The Authorization Header Vulnerability
MODERATECVE-2024-1968 is a MODERATE (CVSS 5.9) scrapy leaks the authorization header vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Scrapy libraries in the PyPI ecosystem. The issue involves scrapy leaks the authorization header on same-domain but cross-origin redirects. Remediation is available by upgrading affected packages to version 2.11.2.
CVE-2024-1968 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-1968
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.11.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-2024-1968, 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.11.2), 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-2024-1968 Affected Scrapy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Scrapy
|
PyPI |
< 2.11.2
|
2.11.2
|
References
Frequently Asked Questions
What is CVE-2024-1968?
Which Scrapy versions are affected?
What version fixes CVE-2024-1968?
Is Scrapy affected?
What is the CVSS score of CVE-2024-1968?
What CWE is associated with CVE-2024-1968?
How can I check PyPI dependencies for CVE-2024-1968?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4qqq-9vqf-3h3f",
"modified" : "2024-05-20T20:22:55Z",
"published" : "2024-05-14T20:14:33Z",
"aliases" : [ "CVE-2024-1968" ],
"summary" : "Scrapy leaks the authorization header on same-domain but cross-origin redirects",
"details" : "### Impact\n\nSince version 2.11.1, Scrapy drops the `Authorization` header when a request is redirected to a different domain. However, it keeps the header if the domain remains the same but the scheme (http/https) or the port change, all scenarios where the header should also be dropped.\n\nIn the context of a man-in-the-middle attack, this could be used to get access to the value of that `Authorization` header\n\n### Patches\n\nUpgrade to Scrapy 2.11.2.\n\n### Workarounds\n\nThere is no easy workaround for unpatched versions of Scrapy. You can replace the built-in redirect middlewares with custom ones patched for this issue, but you have to patch them yourself, manually.\n\n### References\n\nThis security issue was reported and fixed by @szarny at https://huntr.com/bounties/27f6a021-a891-446a-ada5-0226d619dd1a/.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Scrapy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.11.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/scrapy/scrapy/security/advisories/GHSA-4qqq-9vqf-3h3f"
}, {
"type" : "WEB",
"url" : "https://github.com/scrapy/scrapy/commit/1d0502f25bbe55a22899af915623fda1aaeb9dd8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/scrapy/scrapy"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/27f6a021-a891-446a-ada5-0226d619dd1a"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-14T20:14:33Z",
"nvd_published_at" : null
}
}