# CVE-2023-32681: Unintended leak of Proxy-Authorization header in requests

> The Requests library leaks Proxy-Authorization headers to destination servers during HTTPS redirects, allowing attackers to exfiltrate sensitive proxy credentials.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 26 May 2023
- **Updated:** 13 Feb 2025
- **Also known as:** ALSA-2023:4350, ALSA-2023:4520, ALSA-2023:7042, AZL-26985, BELL-CVE-2023-32681, DEBIAN-CVE-2023-32681, DLA-3456-1, ECHO-acbd-1583-01d0, GHSA-j8r2-6x86-q33q, MGASA-2023-0210, MINI-f797-jfff-jfhv, OESA-2023-1341, OESA-2025-2337, OESA-2025-2338, OESA-2025-2339, PYSEC-2023-74, RHSA-2023:4350, RHSA-2023:4520, RHSA-2023:7042, RHSA-2024:0299, RLSA-2023:4520, RLSA-2023:7042, ROOT-APP-PYPI-CVE-2023-32681, SUSE-SU-2023:2638-1, SUSE-SU-2023:2865-1, SUSE-SU-2023:2866-1, SUSE-SU-2023:2883-1, SUSE-SU-2023:3094-1, SUSE-SU-2024:2685-1, UBUNTU-CVE-2023-32681, USN-6155-1, USN-6155-2, openSUSE-SU-2024:12998-1

## What is CVE-2023-32681?

CVE-2023-32681 is a medium-severity vulnerability in Fedoraproject Fedora, published on 26 May 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2023-32681?

3 open source packages ship an affected version, including requests. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `requests` | PyPI | From 2.3.0 | 2.31.0 |
| `requests` | PyPI | From 2.3.0 | 2.31.0 |
| `requests` | PyPI | From 2.3.0 | 2.31.0 |
| `babel` | AlmaLinux:8 | All versions | 2.5.1-10.module_el8.6.0+2781+fed64c13 |
| `python-nose-docs` | AlmaLinux:8 | All versions | 1.3.7-31.module_el8.6.0+2781+fed64c13 |
| `python-psycopg2-doc` | AlmaLinux:8 | All versions | 2.7.5-8.module_el8.9.0+3640+8d3927b5 |
| `python-sqlalchemy-doc` | AlmaLinux:8 | All versions | 1.3.2-2.module_el8.6.0+2781+fed64c13 |
| `python2` | AlmaLinux:8 | All versions | 2.7.18-15.module_el8.9.0+3674+85657c95.alma.1 |
| `python2-Cython` | AlmaLinux:8 | All versions | 0.28.1-7.module_el8.6.0+2781+fed64c13 |
| `python2-Cython` | AlmaLinux:8 | All versions | 0.28.1-7.module_el8.6.0+3162+01a09e5a |
| `python2-PyMySQL` | AlmaLinux:8 | All versions | 0.8.0-10.module_el8.6.0+2781+fed64c13 |
| `python2-attrs` | AlmaLinux:8 | All versions | 17.4.0-10.module_el8.6.0+2781+fed64c13 |
| `python2-babel` | AlmaLinux:8 | All versions | 2.5.1-10.module_el8.6.0+2781+fed64c13 |
| `python2-backports` | AlmaLinux:8 | All versions | 1.0-16.module_el8.6.0+2781+fed64c13 |
| `python2-backports` | AlmaLinux:8 | All versions | 1.0-16.module_el8.6.0+3162+01a09e5a |
| `python2-backports-ssl_match_hostname` | AlmaLinux:8 | All versions | 3.5.0.1-12.module_el8.6.0+2781+fed64c13 |
| `python2-bson` | AlmaLinux:8 | All versions | 3.7.0-1.module_el8.6.0+2781+fed64c13 |
| `python2-bson` | AlmaLinux:8 | All versions | 3.7.0-1.module_el8.6.0+3162+01a09e5a |
| `python2-chardet` | AlmaLinux:8 | All versions | 3.0.4-10.module_el8.6.0+2781+fed64c13 |
| `python2-coverage` | AlmaLinux:8 | All versions | 4.5.1-5.module_el8.9.0+3640+8d3927b5 |
| `python2-debug` | AlmaLinux:8 | All versions | 2.7.18-15.module_el8.9.0+3674+85657c95.alma.1 |
| `python2-devel` | AlmaLinux:8 | All versions | 2.7.18-15.module_el8.9.0+3674+85657c95.alma.1 |
| `python2-dns` | AlmaLinux:8 | All versions | 1.15.0-10.module_el8.6.0+2781+fed64c13 |
| `python2-docs` | AlmaLinux:8 | All versions | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| `python2-docs-info` | AlmaLinux:8 | All versions | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| `python2-docutils` | AlmaLinux:8 | All versions | 0.14-12.module_el8.6.0+2781+fed64c13 |
| `python2-funcsigs` | AlmaLinux:8 | All versions | 1.0.2-13.module_el8.6.0+2781+fed64c13 |
| `python2-idna` | AlmaLinux:8 | All versions | 2.5-7.module_el8.6.0+2781+fed64c13 |
| `python2-ipaddress` | AlmaLinux:8 | All versions | 1.0.18-6.module_el8.6.0+2781+fed64c13 |
| `python2-jinja2` | AlmaLinux:8 | All versions | 2.10-9.module_el8.6.0+2781+fed64c13 |
| `python2-libs` | AlmaLinux:8 | All versions | 2.7.18-15.module_el8.9.0+3674+85657c95.alma.1 |
| `python2-lxml` | AlmaLinux:8 | All versions | 4.2.3-6.module_el8.6.0+2781+fed64c13 |
| `python2-lxml` | AlmaLinux:8 | All versions | 4.2.3-6.module_el8.6.0+3162+01a09e5a |
| `python2-markupsafe` | AlmaLinux:8 | All versions | 0.23-19.module_el8.6.0+2781+fed64c13 |
| `python2-markupsafe` | AlmaLinux:8 | All versions | 0.23-19.module_el8.6.0+3162+01a09e5a |
| `python2-mock` | AlmaLinux:8 | All versions | 2.0.0-13.module_el8.6.0+2781+fed64c13 |
| `python2-nose` | AlmaLinux:8 | All versions | 1.3.7-31.module_el8.6.0+2781+fed64c13 |
| `python2-numpy` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+2781+fed64c13 |
| `python2-numpy` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+3162+01a09e5a |
| `python2-numpy-doc` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+2781+fed64c13 |

Products: Fedoraproject Fedora, Python Requests.

## How do I fix CVE-2023-32681?

Upgrade requests to 2.31.0 or later.

## Is CVE-2023-32681 being exploited?

There is no known exploitation of CVE-2023-32681 in the wild and no public exploit code.

Public exploit code:

- POC for the CVE-2023-32681 (github_poc): https://github.com/hardikmodha/POC-CVE-2023-32681
- Research notes on CVE-2023-32681 (Proxy-Authorization header leak in Python requests) for internal security talk prep (github_poc): https://github.com/mcpmark-eval-liuhezi/requests-sec-notes

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-32681 and fix it if it is affected.

What it is: CVE-2023-32681 is a medium-severity vulnerability in Fedoraproject Fedora, published on 26 May 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-32681 in the wild and no public exploit code.

Affected packages and fixed versions:
- requests (PyPI): affected from 2.3.0; fixed in 2.31.0
- requests (PyPI): affected from 2.3.0; fixed in 2.31.0
- requests (PyPI): affected from 2.3.0; fixed in 2.31.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-32681/ (Markdown: https://insights.sbomify.com/CVE-2023-32681/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-32681
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-32681
- OSV: https://osv.dev/vulnerability/CVE-2023-32681

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-32681/
Summaries are generated and may contain mistakes; the official description above is the record.
