Skip to content

GHSA-34jh-p97f-mpxf CVE-2024-37891 PYSEC-2026-1995

urllib3's Proxy-Authorization request header isn't stripped during cross-origin redirects

Medium PyPI
Severity
4.4 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
1.14%
Chance of exploitation in the next 30 days. Higher than 66.66% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-669 Incorrect Resource Transfer Between Spheres
Fix
1.26.19
Upgrade urllib3 to this version or later

Description

When using urllib3's proxy support with ProxyManager, the Proxy-Authorization header is only sent to the configured proxy, as expected.

However, when sending HTTP requests without using urllib3's proxy support, it's possible to accidentally configure the Proxy-Authorization header even though it won't have any effect as the request is not using a forwarding proxy or a tunneling proxy. In those cases, urllib3 doesn't treat the Proxy-Authorization HTTP header as one carrying authentication material and thus doesn't strip the header on cross-origin redirects.

Because this is a highly unlikely scenario, we believe the severity of this vulnerability is low for almost all users. Out of an abundance of caution urllib3 will automatically strip the Proxy-Authorization header during cross-origin redirects to avoid the small chance that users are doing this on accident.

Users should use urllib3's proxy support or disable automatic redirects to achieve safe processing of the Proxy-Authorization header, but we still decided to strip the header by default in order to further protect users who aren't using the correct approach.

Affected usages

We believe the number of usages affected by this advisory is low. It requires all of the following to be true to be exploited:

  • Setting the Proxy-Authorization header without using urllib3's built-in proxy support.
  • Not disabling HTTP redirects.
  • Either not using an HTTPS origin server or for the proxy or target origin to redirect to a malicious origin.

Remediation

  • Using the Proxy-Authorization header with urllib3's ProxyManager.
  • Disabling HTTP redirects using redirects=False when sending requests.
  • Not using the Proxy-Authorization header.

Affected versions

PyPI

PackageVulnerableFixed in
urllib3
< 1.26.19
1.26.19
urllib3
>= 2.0.0, < 2.2.2
2.2.2
urllib3
< 1.26.19
1.26.19
urllib3
>= 2.0.0, < 2.2.2
2.2.2
urllib3
< 1.26.19
>= 2.0.0, < 2.2.2
1.26.19
2.2.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

urllib3 PyPI → 1.26.19

pip
pip install --upgrade "urllib3>=1.26.19"
poetry
poetry add "urllib3>=1.26.19"
uv
uv add "urllib3>=1.26.19"

Severity breakdown

CVSS 3.1 4.4

CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Weakness

CWE-669: Incorrect Resource Transfer Between Spheres

The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-vxq7-64xx-v4gw
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
High Also affects urllib3
GHSA-gh4c-6fx4-qh6g
urllib3: Chunked Deflate streaming can enter an infinite loop
Medium Also affects urllib3
GHSA-8988-9cw3-xx77
urllib3: HTTPS proxy TLS configuration may be ignored or overridden
High Also affects urllib3
GHSA-mf9v-mfxr-j63j
urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API
High Also affects urllib3
GHSA-qccp-gfcp-xxvc
urllib3: Sensitive headers forwarded across origins in proxied low-level redirects
High Also affects urllib3
GHSA-38jv-5279-wg99
Decompression-bomb safeguards bypassed when following HTTP redirects (streaming API)
High Also affects urllib3
GHSA-2xpw-w6gg-jr37
urllib3 streaming API improperly handles highly compressed data
High Also affects urllib3
GHSA-gm62-xv2j-4w53
urllib3 allows an unbounded number of links in the decompression chain
High Also affects urllib3

Credits: G-Rath, illia-v, pquentin

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor