Repository navigation
chore(deps): update dependency urllib3 to v2.8.0 [security] - autoclosed - #60
Closed
pyhaul-renovate[bot] wants to merge 1 commit into
Closed
pyhaul-renovate[bot] wants to merge 1 commit into
pyhaul-renovate[bot] wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
pyhaul-renovate
Bot
force-pushed
the
renovate/pypi-urllib3-vulnerability
branch
from
September 21, 2026 09:24
e6c7c00 to
d104a1b
Compare
pyhaul-renovate
Bot
force-pushed
the
renovate/pypi-urllib3-vulnerability
branch
from
September 28, 2026 10:17
d104a1b to
1e6c42c
Compare
pyhaul-renovate
Bot
force-pushed
the
renovate/pypi-urllib3-vulnerability
branch
from
October 5, 2026 10:58
1e6c42c to
e4032a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.6.3→2.8.02.6.3→2.8.0urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API
CVE-2026-44432 / GHSA-mf9v-mfxr-j63j
More information
Details
Impact
urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once.
urllib3 can perform decompression based on the HTTP
Content-Encodingheader (e.g.,gzip,deflate,br, orzstd). When using the streaming API since version 2.6.0, the library decompresses only the necessary bytes, enabling partial content consumption.However, urllib3 before version 2.7.0 could still decompress the whole response instead of the requested portion in two cases:
HTTPResponse.read(amt=N)call when the response was decompressed using the official Brotli library.HTTPResponse.drain_conn()was called after the response had been read and decompressed partially (compression algorithm did not matter here).These issues could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This could result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data; CWE-409) on the client side.
Affected usages
Applications and libraries using urllib3 versions earlier than 2.7.0 may be affected when streaming compressed responses from untrusted sources in either of these cases, unless decompression is explicitly disabled:
bris read incrementally with at least twoHTTPResponse.read(amt=N)orHTTPResponse.stream(amt=N)calls while using the official Brotli library.HTTPResponse.drain_conn()is called after response decompression has already started.Remediation
Upgrade to at least urllib3 version 2.7.0 in which the library:
HTTPResponse.drain_conn().If upgrading is not immediately possible, the following workarounds may reduce exposure in specific cases:
HTTPResponse.drain_conn(), callHTTPResponse.close()instead when connection reuse is not important.Credits
The Brotli-specific issue was reported by @kimkou2024.
HTTPResponse.drain_conn()inefficiency was reported by @Cycloctane.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
urllib3: Sensitive headers forwarded across origins in proxied low-level redirects
CVE-2026-44431 / GHSA-qccp-gfcp-xxvc
More information
Details
Impact
When following cross-origin redirects for requests made using urllib3’s high-level APIs, such as
urllib3.request(),PoolManager.request(), andProxyManager.request(), sensitive headers —Authorization,Cookie, andProxy-Authorization(defined inRetry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT) — are stripped by default, as expected.However, cross-origin redirects followed from the low-level API via
ProxyManager.connection_from_url().urlopen(..., assert_same_host=False)still forward these sensitive headers.Affected usage
Applications and libraries using urllib3 versions earlier than 2.7.0 may be affected if they allow cross-origin redirects while making requests through
HTTPConnection.urlopen()instances created viaProxyManager.connection_from_url().Remediation
Upgrade to urllib3 version 2.7.0 or later, in which sensitive headers are stripped from redirects followed by
HTTPConnection.If upgrading is not immediately possible, avoid using this low-level redirect flow for cross-origin redirects. If appropriate for your use case, switch to
ProxyManager.request().Severity
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
urllib3: HTTPS proxy TLS configuration may be ignored or overridden
CVE-2026-97687 / GHSA-8988-9cw3-xx77
More information
Details
Impact
urllib3 supports configuring TLS independently for an HTTPS proxy and the target server.
proxy_ssl_context,proxy_assert_hostname, andproxy_assert_fingerprintconfigure the TLS connection to the proxy.ssl_contextand the other target-specific TLS parameters configure the connection to the target server.In urllib3 versions 1.26.0 through 2.7.0, these configurations were not consistently separated. Depending on the proxy mode, urllib3 could:
proxy_ssl_contextand use the target server's SSL context for the TLS connection to an HTTPS forwarding proxy.In particular, configuring
cert_reqs="CERT_NONE"for a target server could overwrite theverify_modeof the SSL context configured for the HTTPS proxy. This modification occurred in place and persisted on the context object, potentially disabling proxy certificate verification for later connections that reused the same context.An attacker able to intercept the connection to an HTTPS proxy may be able to impersonate the proxy when the effective proxy TLS configuration disables certificate verification or otherwise accepts the attacker's certificate. This may occur, for example, when the target server's trust or identity policy is incorrectly applied to the proxy connection.
When HTTPS forwarding is enabled, an impersonated proxy can observe or modify forwarded requests and responses, potentially exposing credentials, authentication tokens, request bodies, response data, and other sensitive information.
A TLS client certificate intended for the target server may also be presented to the proxy or to an attacker impersonating it. This can disclose the client's identity and provide proof of possession of the corresponding private key. The private key itself is not transmitted during the TLS handshake.
In CONNECT tunneling mode, impersonating the HTTPS proxy does not by itself defeat the separate end-to-end TLS connection between the client and the target server.
Affected Usages
Code using urllib3 versions 1.26.0 through 2.7.0 may be affected in any of the following cases.
1. The target SSL context is used for an HTTPS forwarding proxy
HTTPS requests are forwarded through an HTTPS proxy with
use_forwarding_for_https=True, andproxy_ssl_contextis configured for the proxy.urllib3 may ignore
proxy_ssl_contextand use the target server'sssl_contextfor the proxy TLS handshake. The proxy may therefore be verified using the target server's trust and certificate policy instead of the policy explicitly configured for the proxy.2. The target verification policy overrides the proxy policy
An HTTPS proxy is configured with
proxy_ssl_context, while the target server uses a different certificate-verification policy.urllib3 may apply the target server's
cert_reqsvalue to the proxy SSL context. For example, settingcert_reqs="CERT_NONE"for the target server may also disable certificate verification for the HTTPS proxy, even whenproxy_ssl_contextwas configured to require verification.This issue can affect the TLS connection to an HTTPS proxy in both forwarding and CONNECT tunneling configurations.
3. A mutated proxy SSL context is reused
The same SSL context is reused as
proxy_ssl_contextacross multiple connections, and certificate verification is disabled for one target server.urllib3 may modify the proxy SSL context's
verify_modein place. Later connections that reuse the same context may therefore connect to the HTTPS proxy without certificate verification.4. Target-specific TLS identity or credentials are applied to the proxy
HTTPS requests are forwarded through an HTTPS proxy with
use_forwarding_for_https=True, and target-specific SNI, hostname assertions, certificate fingerprint assertions, or TLS client credentials are configured.urllib3 may apply these target-specific settings to the proxy TLS handshake. This may cause urllib3 to:
Code connecting through a plain HTTP proxy does not establish a TLS connection to the proxy and is not affected by this issue.
Remediation
Upgrade to urllib3 2.8.0 or later.
urllib3 2.8.0 independently applies the explicitly configured
proxy_ssl_contextand proxy-specific certificate assertions to the HTTPS proxy connection. Target-specific SNI, certificate assertions, and TLS client certificate parameters are no longer applied to the HTTPS proxy handshake.For backward compatibility, when an HTTPS proxy is used with
use_forwarding_for_https=Trueandproxy_ssl_contextis not provided, urllib3 2.8.0 continues to usessl_contextfor the TLS connection to the proxy. This configuration emits aFutureWarning. In urllib3 3.0, passingssl_contextwithuse_forwarding_for_https=Truefor an HTTPS proxy will raise an error. Applications should useproxy_ssl_contextto configure TLS for an HTTPS forwarding proxy.The fixes were implemented in commits b6447295fff7b38fdffc67e0df9712d60cef3cc3 and 07408cec79d1856d81bb42c74a904a24fdb9e465.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
CVE-2026-97689 / GHSA-vxq7-64xx-v4gw
More information
Details
Impact
urllib3's streaming API is designed for efficiently handling large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When decoding a chunked-transfer-encoded response, this API reads each chunk's size field by buffering until it sees
\nor EOF.A malicious HTTP server can return
Transfer-Encoding: chunkedand then send a very long run of bytes without any newline, causing the streaming client to buffer that entire run before urllib3 can reject the chunk size as invalid and allocate more memory than intended.To fix the issue, we'll reject chunk-size fields larger than 65536 bytes, as already done in the non-streaming case, which is currently handled by the Python standard library. Note that this only applies to reading the chunk-size field, not the chunk data, which is already handled correctly. Thus, there shouldn't be any impact for non-malicious servers.
Affected usages
Applications and libraries using urllib3 versions earlier than 2.8.0 may be affected when streaming a chunked response from untrusted sources. Specifically, this affects the read_chunked() and stream() methods of the HTTPResponse object.
This also affects requests streaming API, which uses urllib3 under the hood.
Remediation
Upgrade to urllib3 version 2.8.0 or later, where chunk-size fields larger than 65536 will be rejected. If upgrading is not immediately possible, consider reading the response at once using the read() method.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
urllib3: Chunked Deflate streaming can enter an infinite loop
CVE-2026-97688 / GHSA-gh4c-6fx4-qh6g
More information
Details
Impact
urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading content in chunks instead of loading the entire response body into memory at once.
urllib3 can decompress response bodies according to the HTTP
Content-Encodingheader. When streaming a compressed, chunked response, urllib3 first consumes data already buffered by the decoder before reading the next HTTP chunk.However, urllib3 versions from 2.6.2 through 2.7.0 could enter an infinite loop when a chunked response contained bytes after the end of the Deflate stream. If the decompressed body exceeded the requested streaming chunk size, Python's zlib implementation could retain the trailing bytes as unconsumed input after reaching the end of the compressed stream. urllib3 would repeatedly attempt to decode those same bytes without making progress or reading more data from the network.
A malicious server could exploit this behavior to cause excessive CPU usage and prevent the affected request from completing on the client. Network read timeouts would not interrupt the loop because no further socket operation was required.
Affected usages
Applications and libraries using urllib3 versions 2.6.2 through 2.7.0 may be affected when all of the following conditions are met:
HTTPResponse.stream(amt=N)orHTTPResponse.read_chunked(amt=N)with a positive, finite chunk size.Transfer-Encoding: chunkedandContent-Encoding: deflate.HTTPResponse.stream()uses a finite chunk size by default and is therefore affected when the other conditions are met.Remediation
Upgrade to urllib3 2.8.0, in which the Deflate decoder stops accepting input after reaching the end of the compressed stream and no longer reports trailing bytes as data that can produce more decoded output.
If upgrading is not immediately possible, disable automatic content decoding for responses from untrusted sources by setting
decode_content=False, or reject streamed responses using the Deflate content encoding. Applications that disable automatic decoding must handle the compressed response safely at another layer.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API
CVE-2026-44432 / GHSA-mf9v-mfxr-j63j / PYSEC-2026-142
More information
Details
Impact
urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once.
urllib3 can perform decompression based on the HTTP
Content-Encodingheader (e.g.,gzip,deflate,br, orzstd). When using the streaming API since version 2.6.0, the library decompresses only the necessary bytes, enabling partial content consumption.However, urllib3 before version 2.7.0 could still decompress the whole response instead of the requested portion in two cases:
HTTPResponse.read(amt=N)call when the response was decompressed using the official Brotli library.HTTPResponse.drain_conn()was called after the response had been read and decompressed partially (compression algorithm did not matter here).These issues could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This could result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data; CWE-409) on the client side.
Affected usages
Applications and libraries using urllib3 versions earlier than 2.7.0 may be affected when streaming compressed responses from untrusted sources in either of these cases, unless decompression is explicitly disabled:
bris read incrementally with at least twoHTTPResponse.read(amt=N)orHTTPResponse.stream(amt=N)calls while using the official Brotli library.HTTPResponse.drain_conn()is called after response decompression has already started.Remediation
Upgrade to at least urllib3 version 2.7.0 in which the library:
HTTPResponse.drain_conn().If upgrading is not immediately possible, the following workarounds may reduce exposure in specific cases:
HTTPResponse.drain_conn(), callHTTPResponse.close()instead when connection reuse is not important.Credits
The Brotli-specific issue was reported by @kimkou2024.
HTTPResponse.drain_conn()inefficiency was reported by @Cycloctane.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
urllib3: Sensitive headers forwarded across origins in proxied low-level redirects
CVE-2026-44431 / GHSA-qccp-gfcp-xxvc / PYSEC-2026-141
More information
Details
Impact
When following cross-origin redirects for requests made using urllib3’s high-level APIs, such as
urllib3.request(),PoolManager.request(), andProxyManager.request(), sensitive headers —Authorization,Cookie, andProxy-Authorization(defined inRetry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT) — are stripped by default, as expected.However, cross-origin redirects followed from the low-level API via
ProxyManager.connection_from_url().urlopen(..., assert_same_host=False)still forward these sensitive headers.Affected usage
Applications and libraries using urllib3 versions earlier than 2.7.0 may be affected if they allow cross-origin redirects while making requests through
HTTPConnection.urlopen()instances created viaProxyManager.connection_from_url().Remediation
Upgrade to urllib3 version 2.7.0 or later, in which sensitive headers are stripped from redirects followed by
HTTPConnection.If upgrading is not immediately possible, avoid using this low-level redirect flow for cross-origin redirects. If appropriate for your use case, switch to
ProxyManager.request().Severity
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
CVE-2026-44431 / GHSA-qccp-gfcp-xxvc / PYSEC-2026-141
More information
Details
urllib3 is an HTTP client library for Python. From 1.23 to before 2.7.0, cross-origin redirects followed from the low-level API via ProxyManager.connection_from_url().urlopen(..., assert_same_host=False) still forward these sensitive headers. This vulnerability is fixed in 2.7.0.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
CVE-2026-44432 / GHSA-mf9v-mfxr-j63j / PYSEC-2026-142
More information
Details
urllib3 is an HTTP client library for Python. From 2.6.0 to before 2.7.0, urllib3 could decompress the whole response instead of the requested portion (1) during the second HTTPResponse.read(amt=N) call when the response was decompressed using the official Brotli library or (2) when HTTPResponse.drain_conn() was called after the response had been read and decompressed partially (compression algorithm did not matter here). These issues could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This could result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data) on the client side. This vulnerability is fixed in 2.7.0.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
urllib3: HTTPS proxy TLS configuration may be ignored or overridden
CVE-2026-97687 / GHSA-8988-9cw3-xx77 / PYSEC-2026-4175
More information
Details
Impact
urllib3 supports configuring TLS independently for an HTTPS proxy and the target server.
proxy_ssl_context,proxy_assert_hostname, andproxy_assert_fingerprintconfigure the TLS connection to the proxy.ssl_contextand the other target-specific TLS parameters configure the connection to the target server.In urllib3 versions 1.26.0 through 2.7.0, these configurations were not consistently separated. Depending on the proxy mode, urllib3 could:
proxy_ssl_contextand use the target server's SSL context for the TLS connection to an HTTPS forwarding proxy.In particular, configuring
cert_reqs="CERT_NONE"for a target server could overwrite theverify_modeof the SSL context configured for the HTTPS proxy. This modification occurred in place and persisted on the context object, potentially disabling proxy certificate verification for later connections that reused the same context.An attacker able to intercept the connection to an HTTPS proxy may be able to impersonate the proxy when the effective proxy TLS configuration disables certificate verification or otherwise accepts the attacker's certificate. This may occur, for example, when the target server's trust or identity policy is incorrectly applied to the proxy connection.
When HTTPS forwarding is enabled, an impersonated proxy can observe or modify forwarded requests and responses, potentially exposing credentials, authentication tokens, request bodies, response data, and other sensitive information.
A TLS client certificate intended for the target server may also be presented to the proxy or to an attacker impersonating it. This can disclose the client's identity and provide proof of possession of the corresponding private key. The private key itself is not transmitted during the TLS handshake.
In CONNECT tunneling mode, impersonating the HTTPS proxy does not by itself defeat the separate end-to-end TLS connection between the client and the target server.
Affected Usages
Code using urllib3 versions 1.26.0 through 2.7.0 may be affected in any of the following cases.
1. The target SSL context is used for an HTTPS forwarding proxy
HTTPS requests are forwarded through an HTTPS proxy with
use_forwarding_for_https=True, andproxy_ssl_contextis configured for the proxy.urllib3 may ignore
proxy_ssl_contextand use the target server'sssl_contextfor the proxy TLS handshake. The proxy may therefore be verified using the target server's trust and certificate policy instead of the policy explicitly configured for the proxy.2. The target verification policy overrides the proxy policy
An HTTPS proxy is configured with
proxy_ssl_context, while the target server uses a different certificate-verification policy.urllib3 may apply the target server's
cert_reqsvalue to the proxy SSL context. For example, settingcert_reqs="CERT_NONE"for the target server may also disable certificate verification for the HTTPS proxy, even whenproxy_ssl_contextwas configured to require verification.This issue can affect the TLS connection to an HTTPS proxy in both forwarding and CONNECT tunneling configurations.
3. A mutated proxy SSL context is reused
The same SSL context is reused as
proxy_ssl_contextacross multiple connections, and certificate verification is disabled for one target server.urllib3 may modify the proxy SSL context's
verify_modein place. Later connections that reuse the same context may therefore connect to the HTTPS proxy without certificate verification.4. Target-specific TLS identity or credentials are applied to the proxy
HTTPS requests are forwarded through an HTTPS proxy with
use_forwarding_for_https=True, and target-specific SNI, hostname assertions, certificate fingerprint assertions, or TLS client credentials are configured.urllib3 may apply these target-specific settings to the proxy TLS handshake. This may cause urllib3 to:
Code connecting through a plain HTTP proxy does not establish a TLS connection to the proxy and is not affected by this issue.
Remediation
Upgrade to urllib3 2.8.0 or later.
urllib3 2.8.0 independently applies the explicitly configured
proxy_ssl_contextand proxy-specific certificate assertions to the HTTPS proxy connection. Target-specific SNI, certificate assertions, and TLS client certificate parameters are no longer applied to the HTTPS proxy handshake.For backward compatibility, when an HTTPS proxy is used with
use_forwarding_for_https=Trueandproxy_ssl_contextis not provided, urllib3 2.8.0 continues to usessl_contextfor the TLS connection to the proxy. This configuration emits aFutureWarning. In urllib3 3.0, passingssl_contextwithuse_forwarding_for_https=Truefor an HTTPS proxy will raise an error. Applications should useproxy_ssl_contextto configure TLS for an HTTPS forwarding proxy.The fixes were implemented in commits b6447295fff7b38fdffc67e0df9712d60cef3cc3 and 07408cec79d1856d81bb42c74a904a24fdb9e465.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
urllib3: Chunked Deflate streaming can enter an infinite loop
CVE-2026-97688 / GHSA-gh4c-6fx4-qh6g / PYSEC-2026-4176
More information
Details
Impact
urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading content in chunks instead of loading the entire response body into memory at once.
urllib3 can decompress response bodies according to the HTTP
Content-Encodingheader. When streaming a compressed, chunked response, urllib3 first consumes data already buffered by the decoder before reading the next HTTP chunk.However, urllib3 versions from 2.6.2 through 2.7.0 could enter an infinite loop when a chunked response contained bytes after the end of the Deflate stream. If the decompressed body exceeded the requested streaming chunk size, Python's zlib implementation could retain the trailing bytes as unconsumed input after reaching the end of the compressed stream. urllib3 would repeatedly attempt to decode those same bytes without making progress or reading more data from the network.
A malicious server could exploit this behavior to cause excessive CPU usage and prevent the affected request from completing on the client. Network read timeouts would not interrupt the loop because no further socket operation was required.
Affected usages
Applications and libraries using urllib3 versions 2.6.2 through 2.7.0 may be affected when all of the following conditions are met:
HTTPResponse.stream(amt=N)orHTTPResponse.read_chunked(amt=N)with a positive, finite chunk size.Transfer-Encoding: chunkedandContent-Encoding: deflate.HTTPResponse.stream()uses a finite chunk size by default and is therefore affected when the other conditions are met.Remediation
Upgrade to urllib3 2.8.0, in which the Deflate decoder stops accepting input after reaching the end of the compressed stream and no longer reports trailing bytes as data that can produce more decoded output.
If upgrading is not immediately possible, disable automatic content decoding for responses from untrusted sources by setting
decode_content=False, or reject streamed responses using the Deflate content encoding. Applications that disable automatic decoding must handle the compressed response safely at another layer.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
CVE-2026-97689 / GHSA-vxq7-64xx-v4gw / PYSEC-2026-4177
More information
Details
Impact
urllib3's streaming API is designed for efficiently handling large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When decoding a chunked-transfer-encoded response, this API reads each chunk's size field by buffering until it sees
\nor EOF.A malicious HTTP server can return
Transfer-Encoding: chunkedand then send a very long run of bytes without any newline, causing the streaming client to buffer that entire run before urllib3 can reject the chunk size as invalid and allocate more memory than intended.To fix the issue, we'll reject chunk-size fields larger than 65536 bytes, as already done in the non-streaming case, which is currently handled by the Python standard library. Note that this only applies to reading the chunk-size field, not the chunk data, which is already handled correctly. Thus, there shouldn't be any impact for non-malicious servers.
Affected usages
Applications and libraries using urllib3 versions earlier than 2.8.0 may be affected when streaming a chunked response from untrusted sources. Specifically, this affects the read_chunked() and stream() methods of the HTTPResponse object.
This also affects requests streaming API, which uses urllib3 under the hood.
Remediation
Upgrade to urllib3 version 2.8.0 or later, where chunk-size fields larger than 65536 will be rejected. If upgrading is not immediately possible, consider reading the response at once using the read() method.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
urllib3: HTTPS proxy TLS configuration may be ignored or overridden
CVE-2026-97687 / GHSA-8988-9cw3-xx77 / PYSEC-2026-4175
More information
Details
Impact
urllib3 supports configuring TLS independently for an HTTPS proxy and the target server.
proxy_ssl_context,proxy_assert_hostname, andproxy_assert_fingerprintconfigure the TLS connection to the proxy.ssl_contextand the other target-specific TLS parameters configure the connection to the target server.In urllib3 versions 1.26.0 through 2.7.0, these configurations were not consistently separated. Depending on the proxy mode, urllib3 could:
proxy_ssl_contextand use the target server's SSL context for the TLS connection to an HTTPS forwarding proxy.In particular, configuring
cert_reqs="CERT_NONE"for a target server could overwrite theverify_modeof the SSL context configured for the HTTPS proxy. This modification occurred in place and persisted on the context object, potentially disabling proxy certificate verification for later connections that reused the same context.An attacker able to intercept the connection to an HTTPS proxy may be able to impersonate the proxy when the effective proxy TLS configuration disables certificate verification or otherwise accepts the attacker's certificate. This may occur, for example, when the target server's trust or identity policy is incorrectly applied to the proxy connection.
When HTTPS forwarding is enabled, an impersonated proxy can observe or modify forwarded requests and responses, potentially exposing credentials, authentication tokens, request bodies, response data, and other sensitive information.
A TLS client certificate intended for the target server may also be presented to the proxy or to an attacker impersonating it. This can disclose the client's identity and provide proof of possession of the corresponding private key. The private key itself is not transmitted during the TLS handshake.
In CONNECT tunneling mode, impersonating the HTTPS proxy does not by itself defeat the separate end-to-end TLS connection between the client and the target server.
Affected Usages
Code using urllib3 versions 1.26.0 through 2.7.0 may be affected in any of the following cases.
1. The target SSL context is used for an HTTPS forwarding proxy
HTTPS requests are forwarded through an HTTPS proxy with
use_forwarding_for_https=True, andproxy_ssl_contextis configured for the proxy.urllib3 may ignore
proxy_ssl_contextand use the target server'sssl_contextfor the proxy TLS handshake. The proxy may therefore be verified using the target server's trust and certificate policy instead of the policy explicitly configured for the proxy.2. The target verification policy overrides the proxy policy
An HTTPS proxy is configured with
proxy_ssl_context, while the target server uses a different certificate-verification policy.urllib3 may apply the target server's
cert_reqsvalue to the proxy SSL context. For example, settingcert_reqs="CERT_NONE"for the target server may also disable certificate verification for the HTTPS proxy, even whenproxy_ssl_contextwas configured to require verification.This issue can affect the TLS connection to an HTTPS proxy in both forwarding and CONNECT tunneling configurations.
3. A mutated proxy SSL context is reused
The same SSL context is reused as
proxy_ssl_contextacross multiple connections, and certificate verification is disabled for one target server.urllib3 may modify the proxy SSL context's
verify_modein place. Later connections that reuse the same context may therefore connect to the HTTPS proxy without certificate verification.4. Target-specific TLS identity or credentials are applied to the proxy
HTTPS requests are forwarded through an HTTPS proxy with
use_forwarding_for_https=True, and target-specific SNI, hostname assertions, certificate fingerprint assertions, or TLS client credentials are configured.urllib3 may apply these target-specific settings to the proxy TLS handshake. This may cause urllib3 to:
Code connecting through a plain HTTP proxy does not establish a TLS connection to the proxy and is not affected by this issue.
Remediation
Upgrade to urllib3 2.8.0 or later.
urllib3 2.8.0 independently applies the explicitly configured
proxy_ssl_contextand proxy-specific certificate assertions to the HTTPS proxy connection. Target-specific SNI, certificate assertions, and TLS client certificate parameters are no longer applied to the HTTPS proxy handshake.For backward compatibility, when an HTTPS proxy is used with
use_forwarding_for_https=Trueandproxy_ssl_contextis not provided, urllib3 2.8.0 continues to usessl_contextfor the TLS connection to the proxy. This configuration emits aFutureWarning. In urllib3 3.0, passingssl_contextwithuse_forwarding_for_https=Truefor an HTTPS proxy will raise an error. Applications should useproxy_ssl_contextto configure TLS for an HTTPS forwarding proxy.The fixes were implemented in commits b6447295fff7b38fdffc67e0df9712d60cef3cc3 and 07408cec79d1856d81bb42c74a904a24fdb9e465.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
urllib3: Chunked Deflate streaming can enter an infinite loop
CVE-2026-97688 / GHSA-gh4c-6fx4-qh6g / PYSEC-2026-4176
More information
Details
Impact
urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading content in chunks instead of loading the entire response body into memory at once.
urllib3 can decompress response bodies according to the HTTP
Content-Encodingheader. When streaming a compressed, chunked response, urllib3 first consumes data already buffered by the decoder before reading the next HTTP chunk.However, urllib3 versions from 2.6.2 through 2.7.0 could enter an infinite loop when a chunked response contained bytes after the end of the Deflate stream. If the decompressed body exceeded the requested streaming chunk size, Python's zlib implementation could retain the trailing bytes as unconsumed input after reaching the end of the compressed stream. urllib3 would repeatedly attempt to decode those same bytes without making progress or reading more data from the network.
A malicious server could exploit this behavior to cause excessive CPU usage and prevent the affected request from completing on the client. Network read timeouts would not interrupt the loop because no further socket operation was required.
Affected usages
Applications and libraries using urllib3 versions 2.6.2 through 2.7.0 may be affected when all of the following conditions are met:
HTTPResponse.stream(amt=N)orHTTPResponse.read_chunked(amt=N)with a positive, finite chunk size.Transfer-Encoding: chunkedandContent-Encoding: deflate.HTTPResponse.stream()uses a finite chunk size by default and is therefore affected when the other conditions are met.Remediation
Upgrade to urllib3 2.8.0, in which the Deflate decoder stops accepting input after reaching the end of the compressed stream and no longer reports trailing bytes as data that can produce more decoded output.
If upgrading is not immediately possible, disable automatic content decoding for responses from untrusted sources by setting
decode_content=False, or reject streamed responses using the Deflate content encoding. Applications that disable automatic decoding must handle the compressed response safely at another layer.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
CVE-2026-97689 / GHSA-vxq7-64xx-v4gw / PYSEC-2026-4177
More information
Details
Impact
urllib3's streaming API is designed for efficiently handling large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When decoding a chunked-transfer-encoded response, this API reads each chunk's size field by buffering until it sees
\nor EOF.A malicious HTTP server can return
Transfer-Encoding: chunkedand then send a very long run of bytes without any newline, causing the streaming client to buffer that entire run before urllib3 can reject the chunk size as invalid and allocate more memory than intended.To fix the issue, we'll reject chunk-size fields larger than 65536 bytes, as already done in the non-streaming case, which is currently handled by the Python standard library. Note that this only applies to reading the chunk-size field, not the chunk data, which is already handled correctly. Thus, there shouldn't be any impact for non-malicious servers.
Affected usages
Applications and libraries using urllib3 versions earlier than 2.8.0 may be affected when streaming a chunked response from untrusted sources. Specifically, this affects the read_chunked() and stream() methods of the HTTPResponse object.
This also affects requests streaming API, which uses urllib3 under the hood.
Remediation
Upgrade to urllib3 version 2.8.0 or later, where chunk-size fields larger than 65536 will be rejected. I