CVE-2021-41125

Exposure of Sensitive Information to an Unauthorized Actor in pypi/scrapy

Identifiers

CVE-2021-41125, GHSA-jwqp-28gf-p498

Package Slug

pypi/scrapy

Vulnerability

Exposure of Sensitive Information to an Unauthorized Actor

Description

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.

Affected Versions

All versions before 1.8.1, all versions starting from 2.0.0 before 2.5.1

Solution

Upgrade to versions 1.8.1, 2.5.1 or above.

Last Modified

2021-10-18

source