{"id":"CVE-2023-32681","aliases":["CVE-2023-32681","GHSA-j8r2-6x86-q33q","PYSEC-2023-74"],"related":[],"kind":"vulnerability","state":"published","title":"Unintended leak of Proxy-Authorization header in requests","summary":"Requests is a HTTP library. Since Requests 2.3.0, Requests has been leaking Proxy-Authorization headers to destination servers when redirected to an HTTPS endpoint. This is a product of how we use `rebuild_proxies` to reattach the `Proxy-Authorization` header to requests. For HTTP connections sent through the tunnel, 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 the tunneled request. This results in Requests forwarding proxy credentials to the destination server unintentionally, allowing a malicious actor to potentially exfiltrate sensitive information. This issue has been patched in version 2.31.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Requests is a HTTP library. Since Requests 2.3.0, Requests has been leaking Proxy-Authorization headers to destination servers when redirected to an HTTPS endpoint. This is a product of how we use `rebuild_proxies` to reattach the `Proxy-Authorization` header to requests. For HTTP connections sent through the tunnel, 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 the tunneled request. This results in Requests forwarding proxy credentials to the destination server unintentionally, allowing a malicious actor to potentially exfiltrate sensitive information. This issue has been patched in version 2.31.0.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nSince 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](https://github.com/psf/requests/blob/f2629e9e3c7ce3c3c8c025bcd8db551101cbc773/requests/sessions.py#L319-L328) 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`).\n\n**Current vulnerable behavior(s):**\n\n1. HTTP → HTTPS: **leak**\n2. HTTPS → HTTP: **no leak**\n3. HTTPS → HTTPS: **leak**\n4. HTTP → HTTP: **no leak**\n\nFor 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.\n\nThe 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`](https://github.com/psf/requests/blob/f2629e9e3c7ce3c3c8c025bcd8db551101cbc773/requests/adapters.py#L199-L235). 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.\n\n### Patches\nStarting 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.\n\nFor 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.\n\n### Workarounds\nFor users who are not able to update Requests immediately, there is one potential workaround.\n\nYou 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.\n```\nimport requests\nr = requests.get('http://github.com/', allow_redirects=False)\n```\n\n### Credits\n\nThis vulnerability was discovered and disclosed by the following individuals.\n\nDennis Brinkrolf, Haxolot (https://haxolot.com/)\nTobias Funke, (tobiasfunke93@gmail.com)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Requests es una librería HTTP. Desde Requests 2.3.0, Requests ha estado filtrando cabeceras Proxy-Authorization a los servidores de destino cuando se redirige a un endpoint HTTPS. Esto es producto de cómo usamos `rebuild_proxies` para volver a adjuntar la cabecera `Proxy-Authorization` a las peticiones. Para conexiones HTTP enviadas a través del túnel, el proxy identificará la cabecera en la propia petición y la eliminará antes de reenviarla al servidor de destino. Sin embargo, cuando se envía a través de HTTPS, la cabecera `Proxy-Authorization` debe enviarse en la solicitud CONNECT, ya que el proxy no tiene visibilidad sobre la solicitud en túnel. Esto provoca que las solicitudes reenvíen las credenciales del proxy al servidor de destino de forma no intencionada, lo que permite a un actor malicioso filtrar información confidencial. Este problema se ha corregido en la versión 2.31.0.","source":"nvd"}],"published":"2023-05-22T20:36:32.000Z","modified":"2026-09-10T03:50:01.756Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":">= 2.3.0, < 2.31.0","status":"affected"}],"vendor":"psf","product":"requests","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.31.0"}],"ecosystem":"PyPI","package":"requests","purl":"pkg:pypi/requests","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.3.0","fixed":"2.31.0"}],"vendor":"python","product":"requests","cpe":"cpe:2.3:a:python:requests:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"37"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.31.0"}],"ecosystem":"PyPI","package":"requests","purl":"pkg:pypi/requests","repo":"https://github.com/psf/requests","source":"pysec"}],"references":[{"url":"https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33q","tags":["advisory","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/psf/requests/releases/tag/v2.31.0","tags":["release-notes","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7Y/","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZ/","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/06/msg00018.html","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.gentoo.org/glsa/202309-08","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-32681","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/psf/requests","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2023-74.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7Y","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZ","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-01-14T19:35:47.263Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-32681","url":"https://www.cve.org/CVERecord?id=CVE-2023-32681","licence":"CVE Terms of Use","modified":"2025-02-13T16:54:56.639Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j8r2-6x86-q33q","url":"https://github.com/advisories/GHSA-j8r2-6x86-q33q","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:01.756Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-32681","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-32681","licence":"Public domain","modified":"2026-06-17T05:59:22.687Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2023-74","url":"https://osv.dev/vulnerability/PYSEC-2023-74","licence":"CC-BY-4.0","modified":"2023-11-08T04:12:35.436Z"}],"updatedAt":"2026-11-25T22:58:24.399Z","epss":{"score":0.02974,"percentile":0.87617,"date":"2026-12-01T12:00:22.000Z"}}