Open
Conversation
1b8e801 to
9683b95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==2.13.4→==2.14.2Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
GHSA-cwxj-rr6w-m6w7
Impact
Since version 1.4.0, Scrapy respects the
Referrer-Policyresponse header to decide whether and how to set aRefererheader on follow-up requests.If the header value looked like a valid Python import path, Scrapy would import the referenced object and call it, assuming it referred to a referrer policy class (for example,
scrapy.spidermiddlewares.referer.DefaultReferrerPolicy) and attempting to instantiate it to handle theRefererheader.A malicious site could exploit this by setting
Referrer-Policyto a path such assys.exit, causing Scrapy to import and execute it and potentially terminate the process.Patches
Upgrade to Scrapy 2.14.2 (or later).
Workarounds
If you cannot upgrade to Scrapy 2.14.2, consider the following mitigations.
Refererheader on follow-up requests, setREFERER_ENABLEDtoFalse.Referer, disable the middleware and set the header explicitly on the requests that require it.referrer_policyin request metadata: If disabling the middleware is not viable, set thereferrer_policyrequest meta key on all requests to prevent evaluating preceding responses'Referrer-Policy. For example:Instead of editing requests individually, you can:
referrer_policymeta key; orIf you want to continue respecting legitimate
Referrer-Policyheaders while protecting against malicious ones, disable the built-in referrer policy middleware by setting it toNoneinSPIDER_MIDDLEWARESand replace it with the fixed implementation from Scrapy 2.14.2.If the Scrapy 2.14.2 implementation is incompatible with your project (for example, because your Scrapy version is older), copy the corresponding middleware from your Scrapy version, apply the same patch, and use that as a replacement.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HRelease Notes
scrapy/scrapy (scrapy)
v2.14.2Compare Source
Referrer-Policyheader of HTTP responses are no longer executed as Python callables. See the cwxj-rr6w-m6w7 security advisory for details.Full Changelog
v2.14.1Compare Source
maybeDeferred_coro(){open,close}_spider()Full Changelog
v2.14.0Compare Source
DownloaderAwarePriorityQueueFull changelog
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.