{"answers":{"affected":"2 open source packages ship an affected version, including Scrapy and scrapy.","exploited":"There is no known exploitation of GHSA-23j4-mw76-5v7h in the wild and no public exploit code.","fix":"Upgrade Scrapy to 2.11.2 or later.","what":"GHSA-23j4-mw76-5v7h is a server-side request forgery vulnerability in Scrapy, published on 14 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-23j4-mw76-5v7h and fix it if it is affected.\n\nWhat it is: GHSA-23j4-mw76-5v7h is a server-side request forgery vulnerability in Scrapy, published on 14 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-23j4-mw76-5v7h in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- Scrapy (PyPI): affected all versions; fixed in 2.11.2\n- scrapy (PyPI): affected all versions; fixed in 2.11.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-23j4-mw76-5v7h/ (Markdown: https://insights.sbomify.com/GHSA-23j4-mw76-5v7h/index.md)","id":"GHSA-23j4-mw76-5v7h","markdown":"https://insights.sbomify.com/GHSA-23j4-mw76-5v7h/index.md","name":"GHSA-23j4-mw76-5v7h","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Python web scraping library","requires_auth":"none","summary":"Scrapy allows redirect following in non-HTTP protocols, enabling attackers to read local files or steal credentials via malicious redirects.","user_interaction":"not_required","vuln_class":"ssrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\nScrapy was following redirects regardless of the URL protocol, so redirects were working for `data://`, `file://`, `ftp://`, `s3://`, and any other scheme defined in the `DOWNLOAD_HANDLERS` setting.\n\nHowever, HTTP redirects should only work between URLs that use the `http://` or `https://` schemes.\n\nA malicious actor, given write access to the start requests (e.g. ability to define `start_urls`) of a spider and read access to the spider output, could exploit this vulnerability to:\n- Redirect to any local file using the `file://` scheme to read its contents.\n- Redirect to an `ftp://` URL of a malicious FTP server to obtain the FTP username and password configured in the spider or project.\n- Redirect to any `s3://` URL to read its content using the S3 credentials configured in the spider or project.\n\nFor `file://` and `s3://`, how the spider implements its parsing of input data into an output item determines what data would be vulnerable. A spider that always outputs the entire contents of a response would be completely vulnerable, while a spider that extracted only fragments from the response could significantly limit vulnerable data.\n\n### Patches\n\nUpgrade to Scrapy 2.11.2.\n\n### Workarounds\n\nReplace the built-in retry middlewares (`RedirectMiddleware` and `MetaRefreshMiddleware`) with custom ones that implement the fix from Scrapy 2.11.2, and verify that they work as intended.\n\n### References\n\nThis security issue was reported by @mvsantos at https://github.com/scrapy/scrapy/issues/457.","ecosystems":["PyPI"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Scrapy allows redirect following in protocols other than HTTP","id":"GHSA-23j4-mw76-5v7h","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"ssrf","year":"2024"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"PyPI","fixed":["2.11.2"],"introduced":["0"],"last_affected":[],"package":"Scrapy","purl":null,"source":"GHSA-23j4-mw76-5v7h"},{"ecosystem":"PyPI","fixed":["2.11.2"],"introduced":["0"],"last_affected":[],"package":"scrapy","purl":"pkg:pypi/scrapy","source":"GHSA-23j4-mw76-5v7h"}],"products":null,"published":"2024-05-14","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Scrapy allows redirect following in non-HTTP protocols, enabling attackers to read local files or steal credentials via malicious redirects.","url":"https://insights.sbomify.com/GHSA-23j4-mw76-5v7h/"}