CVE-2023-32681 — Vulnerability in requests — CVE Details
Unintended leak of Proxy-Authorization header in requests
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (2.57%). Schedule for your next planned update.
Does your project use an affected requests version?
Paste your requirements.txt to check it for CVE-2023-32681 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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)
Advisory Timeline
- First published May 22, 2023 (1284 days ago).
- Last revised September 10, 2026 — 1206 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "requests>=2.31.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| requests PyPI · Affected: 2.10.0, 2.11.0, 2.11.1, 2.12.0 (+62 more) | 2.31.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-200Information ExposureMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N
References
- https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33qWEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-32681ADVISORY
- https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5WEB
- https://github.com/psf/requestsPACKAGE
- https://github.com/psf/requests/releases/tag/v2.31.0WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2023-74.yamlWEB
- https://lists.debian.org/debian-lts-announce/2023/06/msg00018.htmlWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7YWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZWEB
- https://security.gentoo.org/glsa/202309-08WEB
Frequently Asked Questions
- What is CVE-2023-32681?
- Unintended leak of Proxy-Authorization header in requests. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
- How do I check if my project is affected by CVE-2023-32681?
- CVE-2023-32681 affects requests. It has a 2.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-32681 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This places it in the top quartile of EPSS-scored vulnerabilities — 85.9% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2024-47081MEDIUM
Requests vulnerable to .netrc credentials leak via malicious URLs
- CVE-2024-35195MEDIUM
Requests `Session` object does not verify requests after making first request with verify=False
- CVE-2026-25645MEDIUM
- CVE-2026-129221MEDIUM
NLTK: ARFF_Formatter Injects Weka ARFF Schema Directives via Attacker-Controlled Class Labels
- CVE-2024-47081MEDIUM
Requests vulnerable to .netrc credentials leak via malicious URLs
- CVE-2024-35195MEDIUM
Requests `Session` object does not verify requests after making first request with verify=False
- CVE-2026-25645MEDIUM
Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function
- CVE-2026-128140MEDIUM
NLTK: Downloader cyclic collection indices cause an infinite closure walk