Python/requests/2.9.2
Python HTTP for Humans.
https://pypi.org/project/requests
Apache-2.0
5 Security Vulnerabilities
Requests vulnerable to .netrc credentials leak via malicious URLs
- 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
- 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://github.com/advisories/GHSA-9hjg-9r4m-mvj7
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
Requests `Session` object does not verify requests after making first request with verify=False
- https://github.com/psf/requests/security/advisories/GHSA-9wx4-h78v-vm56
- https://github.com/psf/requests/pull/6655
- https://github.com/psf/requests/commit/a58d7f2ffb4d00b46dca2d70a3932a0b37e22fac
- https://nvd.nist.gov/vuln/detail/CVE-2024-35195
- https://github.com/advisories/GHSA-9wx4-h78v-vm56
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IYLSNK5TL46Q6XPRVMHVWS63MVJQOK4Q
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/N7WP6EYDSUOCOJYHDK5NX43PYZ4SNHGZ
When using a requests.Session, if the first request to a given origin is made with verify=False, TLS certificate verification may remain disabled for all subsequent requests to that origin, even if verify=True is explicitly specified later.
This occurs because the underlying connection is reused from the session's connection pool, causing the initial TLS verification setting to persist for the lifetime of the pooled connection. As a result, applications may unintentionally send requests without certificate verification, leading to potential man-in-the-middle attacks and compromised confidentiality or integrity.
This behavior affects versions of requests prior to 2.32.0.
Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function
- https://github.com/psf/requests/security/advisories/GHSA-gc5v-m9x4-r6x2
- https://github.com/psf/requests/commit/66d21cb07bd6255b1280291c4fafb71803cdb3b7
- https://github.com/psf/requests/releases/tag/v2.33.0
- https://github.com/advisories/GHSA-gc5v-m9x4-r6x2
- https://nvd.nist.gov/vuln/detail/CVE-2026-25645
Impact
The requests.utils.extract_zipped_paths() utility function uses a predictable filename when extracting files from zip archives into the system temporary directory. If the target file already exists, it is reused without validation. A local attacker with write access to the temp directory could pre-create a malicious file that would be loaded in place of the legitimate one.
Affected usages
Standard usage of the Requests library is not affected by this vulnerability. Only applications that call extract_zipped_paths() directly are impacted.
Remediation
Upgrade to at least Requests 2.33.0, where the library now extracts files to a non-deterministic location.
If developers are unable to upgrade, they can set TMPDIR in their environment to a directory with restricted write access.
Unintended leak of Proxy-Authorization header in requests
- https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33q
- https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5
- https://github.com/advisories/GHSA-j8r2-6x86-q33q
- https://nvd.nist.gov/vuln/detail/CVE-2023-32681
- https://github.com/psf/requests/releases/tag/v2.31.0
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7Y/
- https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2023-74.yaml
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZ/
- https://lists.debian.org/debian-lts-announce/2023/06/msg00018.html
- https://security.gentoo.org/glsa/202309-08
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7Y
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZ
Impact
Since Requests v2.3.0, Requests has been vulnerable to potentially leaking Proxy-Authorization headers to destination servers, specifically during redirects to an HTTPS origin. This is a product of how rebuild_proxies is used to recompute and reattach the Proxy-Authorization header to requests when redirected. Note this behavior has only been observed to affect proxied requests when credentials are supplied in the URL user information component (e.g. https://username:password@proxy:8080).
Current vulnerable behavior(s):
- HTTP → HTTPS: leak
- HTTPS → HTTP: no leak
- HTTPS → HTTPS: leak
- HTTP → HTTP: no leak
For HTTP connections sent through the proxy, the proxy will identify the header in the request itself and remove it prior to forwarding to the destination server. However when sent over HTTPS, the Proxy-Authorization header must be sent in the CONNECT request as the proxy has no visibility into further tunneled requests. This results in Requests forwarding the header to the destination server unintentionally, allowing a malicious actor to potentially exfiltrate those credentials.
The reason this currently works for HTTPS connections in Requests is the Proxy-Authorization header is also handled by urllib3 with our usage of the ProxyManager in adapters.py with proxy_manager_for. This will compute the required proxy headers in proxy_headers and pass them to the Proxy Manager, avoiding attaching them directly to the Request object. This will be our preferred option going forward for default usage.
Patches
Starting in Requests v2.31.0, Requests will no longer attach this header to redirects with an HTTPS destination. This should have no negative impacts on the default behavior of the library as the proxy credentials are already properly being handled by urllib3's ProxyManager.
For users with custom adapters, this may be potentially breaking if you were already working around this behavior. The previous functionality of rebuild_proxies doesn't make sense in any case, so we would encourage any users impacted to migrate any handling of Proxy-Authorization directly into their custom adapter.
Workarounds
For users who are not able to update Requests immediately, there is one potential workaround.
You may disable redirects by setting allow_redirects to False on all calls through Requests top-level APIs. Note that if you're currently relying on redirect behaviors, you will need to capture the 3xx response codes and ensure a new request is made to the redirect destination. import requests r = requests.get('http://github.com/', allow_redirects=False)
Credits
This vulnerability was discovered and disclosed by the following individuals.
Dennis Brinkrolf, Haxolot (https://haxolot.com/) Tobias Funke, (tobiasfunke93@gmail.com)
Insufficiently Protected Credentials in Requests
- https://nvd.nist.gov/vuln/detail/CVE-2018-18074
- https://github.com/advisories/GHSA-x84v-xcm2-53pg
- https://github.com/requests/requests/issues/4716
- https://github.com/requests/requests/pull/4718
- https://github.com/requests/requests/commit/c45d7c49ea75133e52ab22a8e9e13173938e36ff
- https://access.redhat.com/errata/RHSA-2019:2035
- https://bugs.debian.org/910766
- https://usn.ubuntu.com/3790-1/
- https://usn.ubuntu.com/3790-2/
- http://docs.python-requests.org/en/master/community/updates/#release-and-version-history
- http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00024.html
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2018-28.yaml
- https://usn.ubuntu.com/3790-1
- https://usn.ubuntu.com/3790-2
The Requests package through 2.19.1 before 2018-09-14 for Python sends an HTTP Authorization header to an http URI upon receiving a same-hostname https-to-http redirect, which makes it easier for remote attackers to discover credentials by sniffing the network.
163 Other Versions
| Version | License | Security | Released | |
|---|---|---|---|---|
| 0.13.6 | ISC | 6 | 2012-08-06 - 08:46 | almost 14 years |
| 0.13.5 | UNKNOWN | 6 | 2012-07-27 - 09:23 | almost 14 years |
| 0.13.4 | ISC | 6 | 2012-07-27 - 08:22 | almost 14 years |
| 0.13.3 | ISC | 6 | 2012-07-12 - 23:20 | almost 14 years |
| 0.13.2 | UNKNOWN | 6 | 2012-06-29 - 02:37 | almost 14 years |
| 0.13.1 | ISC | 6 | 2012-06-08 - 04:22 | almost 14 years |
| 0.13.0 | ISC | 6 | 2012-05-30 - 02:54 | almost 14 years |
| 0.12.1 | ISC | 6 | 2012-05-08 - 07:21 | about 14 years |
| 0.12.01 | UNKNOWN | 6 | 1970-01-01 - 00:00 | over 56 years |
| 0.12.0 | ISC | 6 | 2012-05-03 - 01:18 | about 14 years |
| 0.11.2 | ISC | 6 | 2012-04-23 - 04:29 | about 14 years |
| 0.11.1 | ISC | 6 | 2012-03-31 - 05:47 | about 14 years |
| 0.10.8 | ISC | 6 | 2012-03-09 - 17:59 | about 14 years |
| 0.10.7 | ISC | 6 | 2012-03-08 - 01:50 | about 14 years |
| 0.10.6 | ISC | 6 | 2012-02-26 - 05:17 | about 14 years |
| 0.10.4 | ISC | 6 | 2012-02-20 - 22:21 | about 14 years |
| 0.10.3 | ISC | 6 | 2012-02-20 - 20:10 | about 14 years |
| 0.10.2 | ISC | 6 | 2012-02-15 - 09:48 | over 14 years |
| 0.10.1 | ISC | 6 | 2012-01-23 - 08:22 | over 14 years |
| 0.10.0 | ISC | 6 | 2012-01-22 - 05:08 | over 14 years |
| 0.9.3 | ISC | 6 | 2012-01-19 - 16:51 | over 14 years |
| 0.9.2 | ISC | 6 | 2012-01-19 - 03:39 | over 14 years |
| 0.9.1 | ISC | 6 | 2012-01-06 - 07:11 | over 14 years |
| 0.9.0 | ISC | 6 | 2011-12-28 - 10:51 | over 14 years |
| 0.8.9 | ISC | 6 | 2011-12-28 - 10:34 | over 14 years |
| 0.8.8 | ISC | 6 | 2011-12-28 - 09:55 | over 14 years |
| 0.8.7 | ISC | 6 | 2011-12-24 - 09:18 | over 14 years |
| 0.8.6 | ISC | 6 | 2011-12-19 - 01:18 | over 14 years |
| 0.8.5 | ISC | 6 | 2011-12-14 - 16:43 | over 14 years |
| 0.8.4 | ISC | 6 | 2011-12-11 - 17:40 | over 14 years |
| 0.8.3 | ISC | 6 | 2011-11-27 - 16:44 | over 14 years |
| 0.8.2 | ISC | 6 | 2011-11-19 - 22:28 | over 14 years |
| 0.8.1 | ISC | 6 | 2011-11-15 - 16:01 | over 14 years |
| 0.8.0 | ISC | 6 | 2011-11-13 - 06:52 | over 14 years |
| 0.7.6 | ISC | 6 | 2011-11-07 - 20:19 | over 14 years |
| 0.7.5 | ISC | 6 | 2011-11-05 - 04:32 | over 14 years |
| 0.7.4 | ISC | 6 | 2011-10-27 - 00:36 | over 14 years |
| 0.7.3 | ISC | 6 | 2011-10-23 - 23:04 | over 14 years |
| 0.7.2 | ISC | 6 | 2011-10-23 - 21:40 | over 14 years |
| 0.7.1 | ISC | 6 | 2011-10-23 - 21:19 | over 14 years |
| 0.7.0 | ISC | 6 | 2011-10-23 - 03:33 | over 14 years |
| 0.6.6 | ISC | 6 | 2011-10-19 - 09:39 | over 14 years |
| 0.6.5 | ISC | 6 | 2011-10-19 - 07:30 | over 14 years |
| 0.6.4 | ISC | 6 | 2011-10-14 - 04:23 | over 14 years |
| 0.6.3 | ISC | 6 | 2011-10-14 - 03:35 | over 14 years |
| 0.6.2 | ISC | 6 | 2011-10-09 - 13:12 | over 14 years |
| 0.6.1 | ISC | 6 | 2011-08-21 - 00:25 | over 14 years |
| 0.6.0 | ISC | 6 | 2011-08-17 - 10:33 | almost 15 years |
| 0.5.1 | ISC | 6 | 2011-07-24 - 05:01 | almost 15 years |
| 0.5.0 | ISC | 6 | 2011-06-22 - 04:44 | almost 15 years |
