cve.bz

CVE-2021-41125 Insufficiently Protected Credentials

6.5 mediumEPSS 1.3%Fix available

Medium (6.5). EPSS 1.3% estimated probability of exploitation activity in the next 30 days. Fixed in scrapy 1.8.1, 2.5.1.

On this page
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. Upgrade to Scrapy 2.5.1 and use the new `http_auth_domain` spider attribute to control which domains are allowed to receive the configured HTTP authentication credentials. If you are using Scrapy 1.8 or a lower version, and upgrading to Scrapy 2.5.1 is not an option, you may upgrade to Scrapy 1.8.1 instead. If you cannot upgrade, 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`.

Severity

CVSS 3.1

6.5 medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
EPSS
1.3% (unchanged from 1.3% a week ago; 1.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 70th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-522 Insufficiently Protected Credentials
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
OWASP Top 10
A01:2025 Broken Access Control, A06:2025 Insecure Design
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-41125 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-41125?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-41125?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-41125 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
scrapy:scrapybefore 1.8.1
scrapy:scrapyfrom 2.0.0 before 2.5.1
debian:debian_linux9.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-jwqp-28gf-p498PyPIscrapy<1.8.11.8.1
GHSA-jwqp-28gf-p498PyPIscrapy>=2.0.0 <2.5.12.5.1
PYSEC-2021-363PyPIscrapy<1.8.1
>=2.0.0 <2.5.1
1.8.1, 2.5.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9python-scrapy1.0.3-2+deb9u1DLA-2950-1
Debian12, 13, 14python-scrapy2.5.1-1DEBIAN-CVE-2021-41125
Ubuntu16.04:LTSpython-scrapyno fix listedUBUNTU-CVE-2021-41125
UbuntuPro:18.04:LTSpython-scrapy1.5.0-1ubuntu0.1~esm1UBUNTU-CVE-2021-41125 USN-7476-1
UbuntuPro:20.04:LTSpython-scrapy1.7.3-1ubuntu0.1~esm1UBUNTU-CVE-2021-41125 USN-7476-1
UbuntuPro:22.04:LTSpython-scrapy2.5.1-2ubuntu0.1~esm1USN-7476-1
UbuntuPro:24.04:LTSpython-scrapy2.11.1-1ubuntu0.1~esm2USN-7476-1
openSUSETumbleweedpython-Scrapy2.5.1-1.1openSUSE-SU-2024:11558-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · openSUSE.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-522 (13), CWE-200 (59).

References

Check your stackJSON