CVE-2021-41125: Exposure of Sensitive Information to an Unauthorized Actor
(updated )
Scrapy is a high-level web crawling and scraping framework for Python. If you use HttpAuthMiddleware
(i.e. the http_user
and http_pass
spider attributes) for HTTP authentication, all requests will expose your credentials to the request target. This includes requests generated by Scrapy components, such as robots.txt
requests sent by Scrapy when the ROBOTSTXT_OBEY
setting is set to True
, or as requests reached through redirects. If you cannot upgrade to a patched version, set your HTTP authentication credentials on a per-request basis, using for example the w3lib.http.basic_auth_header
function to convert your credentials into a value that you can assign to the Authorization
header of your request, instead of defining your credentials globally using HttpAuthMiddleware
.
References
Detect and mitigate CVE-2021-41125 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →