{"id":"GHSA-mfjm-vh54-3f96","aliases":["GHSA-mfjm-vh54-3f96"],"related":[],"kind":"vulnerability","state":"published","title":"Scrapy cookie-setting is not restricted based on the public suffix list","summary":"### 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)","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"}],"published":"2022-03-01T22:13:28.000Z","modified":"2024-12-07T05:40:29.120Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.8.2"}],"ecosystem":"PyPI","package":"scrapy","purl":"pkg:pypi/scrapy","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.6.0"}],"ecosystem":"PyPI","package":"scrapy","purl":"pkg:pypi/scrapy","source":"ghsa"}],"references":[{"url":"https://github.com/scrapy/scrapy/security/advisories/GHSA-mfjm-vh54-3f96","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/scrapy/scrapy/commit/e865c4430e58a4faa0e0766b23830f8423d6167a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/scrapy/scrapy","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mfjm-vh54-3f96","url":"https://github.com/advisories/GHSA-mfjm-vh54-3f96","licence":"CC-BY-4.0","modified":"2024-12-07T05:40:29.120Z"}],"updatedAt":"2026-11-25T22:56:35.932Z"}