Requests vulnerable to .netrc credentials leak via malicious URLs
Published 9 Jun 2025 · Updated 19 Oct 2026
Is your project on an affected requests?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <2.32.4
- Fixed in
- 2.32.4
pip install 'requests>=2.32.4'Details
Impact
Due to a URL parsing issue, Requests releases prior to 2.32.4 may leak .netrc credentials to third parties for specific maliciously-crafted URLs.
Workarounds
For older versions of Requests, use of the .netrc file can be disabled with trust_env=False on your Requests Session (docs).
References
https://github.com/psf/requests/pull/6965 https://seclists.org/fulldisclosure/2025/Jun/2
Is GHSA-9hjg-9r4m-mvj7 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected requests, and gives you the command that fixes it.
More advisories for requests
- MediumCVE-2026-25645Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function · 25 Mar 2026
- MediumCVE-2024-35195Requests `Session` object does not verify requests after making first request with verify=False · 20 May 2024
- MediumCVE-2023-32681Unintended leak of Proxy-Authorization header in requests · 22 May 2023
- MediumCVE-2014-1829Exposure of Sensitive Information to an Unauthorized Actor in Requests · 17 May 2022
- MediumCVE-2014-1830Exposure of Sensitive Information to an Unauthorized Actor in Requests · 14 May 2022
- MediumCVE-2015-2296Python Requests Session Fixation · 13 May 2022
References
- Linkgithub.com/psf/requests/security/advisories/GHSA-9hjg-9r4m-mvj7
- Advisorynvd.nist.gov/vuln/detail/CVE-2024-47081
- Linkgithub.com/psf/requests/pull/6965
- Linkgithub.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef
- Advisorygithub.com/advisories/GHSA-9hjg-9r4m-mvj7
- Packagegithub.com/psf/requests
- Linkgithub.com/psf/requests/releases/tag/v2.32.4
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2026-1872.yaml
- Linkpypi.org/project/requests
- Linkrequests.readthedocs.io/en/latest/api/#requests.Session.trust_env
- Linkseclists.org/fulldisclosure/2025/Jun/2
- Linkwww.openwall.com/lists/oss-security/2025/06/03/11
- Linkwww.openwall.com/lists/oss-security/2025/06/03/9
- Linkwww.openwall.com/lists/oss-security/2025/06/04/1
- Linkwww.openwall.com/lists/oss-security/2025/06/04/6
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.