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 trust_env=False on your Requests Session (docs).
References
https://github.com/psf/requests/pull/6965 https://seclists.org/fulldisclosure/2025/Jun/2
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | requests | < 2.32.4 | 2.32.4 |
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://github.com/psf/requests
- https://requests.readthedocs.io/en/latest/api/#requests.Session.trust_env
- https://seclists.org/fulldisclosure/2025/Jun/2
- http://seclists.org/fulldisclosure/2025/Jun/2
- http://www.openwall.com/lists/oss-security/2025/06/03/11
- http://www.openwall.com/lists/oss-security/2025/06/03/9
- http://www.openwall.com/lists/oss-security/2025/06/04/1
- http://www.openwall.com/lists/oss-security/2025/06/04/6
- https://pypi.org/project/requests
- https://github.com/advisories/GHSA-9hjg-9r4m-mvj7
- https://github.com/psf/requests/releases/tag/v2.32.4
- https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2026-1872.yaml
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-522- Platform
- Python (PyPI)
- Package
requests- Disclosed
- 09.06.2025
- Updated
- 19.10.2026 22:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-1872 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-9hjg-9r4m-mvj7 - CC BY 4.0
Vulnerability history: requests
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 8
- First → latest
- 10.2014 03.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 1
- Medium 7
Disclosures per year
- 2017: 0
- 2018: 1
- 2019: 0
- 2020: 0
- 2021: 0
- 2022: 0
- 2023: 1
- 2024: 1
- 2025: 1
- 2026: 1
earlier: 3
-
Requests vulnerable to .netrc credentials leak via malicious URLs this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.