CVE-2024-47081: Requests vulnerable to .netrc credentials leak via malicious URLs
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 trustenv=False on your Requests Session (docs). References https://github.com/psf/requests/pull/6965 https://seclists.org/fulldisclosure/2025/Jun/2
Published Jun 9, 2025 · Updated Oct 19, 2026
Affected packages
requests
- Ecosystem
- PyPI
- Affected
- < 2.32.4
- Fixed in
- 2.32.4
- Check
pip show requests
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
Credited to sethmlarson, jupenur, nateprewitt, sigmavirus24, omerlevyk.
References
- https://github.com/psf/requests/security/advisories/GHSA-9hjg-9r4m-mvj7
- https://nvd.nist.gov/vuln/detail/CVE-2024-47081
- https://github.com/psf/requests/pull/6965
- https://github.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef
- https://requests.readthedocs.io/en/latest/api/#requests.Session.trust_env
- https://seclists.org/fulldisclosure/2025/Jun/2
- https://github.com/advisories/GHSA-9hjg-9r4m-mvj7
- https://github.com/psf/requests
- https://github.com/psf/requests/releases/tag/v2.32.4
- https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2026-1872.yaml
- https://pypi.org/project/requests
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
