{"answers":{"affected":"4 open source packages ship an affected version, including scrapy.","exploited":"There is no known exploitation of GHSA-mfjm-vh54-3f96 in the wild and no public exploit code.","fix":"Upgrade scrapy to a fixed version for your release line: 1.8.2 or 2.6.0.","what":"GHSA-mfjm-vh54-3f96 is a vulnerability in scrapy, published on 1 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-mfjm-vh54-3f96 and fix it if it is affected.\n\nWhat it is: GHSA-mfjm-vh54-3f96 is a vulnerability in scrapy, published on 1 Mar 2022. 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-mfjm-vh54-3f96 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- scrapy (PyPI): affected all versions; fixed in 1.8.2\n- scrapy (PyPI): affected all versions; fixed in 1.8.2\n- scrapy (PyPI): affected from 2.0.0; fixed in 2.6.0\n- scrapy (PyPI): affected from 2.0.0; fixed in 2.6.0\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-mfjm-vh54-3f96/ (Markdown: https://insights.sbomify.com/GHSA-mfjm-vh54-3f96/index.md)","id":"GHSA-mfjm-vh54-3f96","markdown":"https://insights.sbomify.com/GHSA-mfjm-vh54-3f96/index.md","name":"GHSA-mfjm-vh54-3f96","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 malicious sites to set cookies for other domains sharing a public suffix, enabling session hijacking or data leakage.","user_interaction":"not_required","vuln_class":"other"},"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\nResponses from domain names whose public domain name suffix contains 1 or more periods (e.g. responses from `example.co.uk`, given its public domain name suffix is `co.uk`) are able to set cookies that are included in requests to any other domain sharing the same domain name suffix.\n\n### Patches\n\nUpgrade to Scrapy 2.6.0, which restricts cookies with their domain set to any of those in the [public suffix list](https://publicsuffix.org/).\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### Workarounds\n\nThe only workaround for unpatched versions of Scrapy is to [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 a subset that does not include domain names with one of the public domain suffixes affected (those with 1 or more periods).\n\n### References\n* https://publicsuffix.org/\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)","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 cookie-setting is not restricted based on the public suffix list","id":"GHSA-mfjm-vh54-3f96","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"other","year":"2022"},"n_packages":4,"n_references":null,"packages":[{"ecosystem":"PyPI","fixed":["1.8.2"],"introduced":["0"],"last_affected":[],"package":"scrapy","purl":null,"source":"GHSA-mfjm-vh54-3f96"},{"ecosystem":"PyPI","fixed":["1.8.2"],"introduced":["0"],"last_affected":[],"package":"scrapy","purl":"pkg:pypi/scrapy","source":"GHSA-mfjm-vh54-3f96"},{"ecosystem":"PyPI","fixed":["2.6.0"],"introduced":["2.0.0"],"last_affected":[],"package":"scrapy","purl":null,"source":"GHSA-mfjm-vh54-3f96"},{"ecosystem":"PyPI","fixed":["2.6.0"],"introduced":["2.0.0"],"last_affected":[],"package":"scrapy","purl":"pkg:pypi/scrapy","source":"GHSA-mfjm-vh54-3f96"}],"products":null,"published":"2022-03-01","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 malicious sites to set cookies for other domains sharing a public suffix, enabling session hijacking or data leakage.","url":"https://insights.sbomify.com/GHSA-mfjm-vh54-3f96/"}