14 Commits

Author SHA256 Message Date
9b7c83e503 Accepting request 1287779 from devel:languages:python
- Update to 2.5.0:
  * Security issues
    Pool managers now properly control redirects when retries is passed
    (CVE-2025-50181, GHSA-pq67-6m6q-mj2v, bsc#1244925)
    Redirects are now controlled by urllib3 in the Node.js runtime
    (CVE-2025-50182, GHSA-48p4-8xcf-vxj5, bsc#1244924)
  * Features
    Added support for the compression.zstd module that is new in Python 3.14.
    Added support for version 0.5 of hatch-vcs
  * Bugfixes
    Raised exception for HTTPResponse.shutdown on a connection already
    released to the pool.
    Fixed incorrect CONNECT statement when using an IPv6 proxy with
    connection_from_host. Previously would not be wrapped in [].

OBS-URL: https://build.opensuse.org/request/show/1287779
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=72
2025-06-24 18:45:47 +00:00
bfb74b5d59 - Update to 2.5.0:
* Security issues
    Pool managers now properly control redirects when retries is passed
    (CVE-2025-50181, GHSA-pq67-6m6q-mj2v, bsc#1244925)
    Redirects are now controlled by urllib3 in the Node.js runtime
    (CVE-2025-50182, GHSA-48p4-8xcf-vxj5, bsc#1244924)
  * Features
    Added support for the compression.zstd module that is new in Python 3.14.
    Added support for version 0.5 of hatch-vcs
  * Bugfixes
    Raised exception for HTTPResponse.shutdown on a connection already
    released to the pool.
    Fixed incorrect CONNECT statement when using an IPv6 proxy with
    connection_from_host. Previously would not be wrapped in [].

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=190
2025-06-23 02:04:11 +00:00
c51cbf40e7 Accepting request 1280514 from devel:languages:python
- Update to 2.4.0
  * Applied PEP 639 by specifying the license fields in
    pyproject.toml. (#3522)
  * Updated exceptions to save and restore more properties during the
    pickle/serialization process. (#3567)
  * Added verify_flags option to create_urllib3_context with a default
    of VERIFY_X509_PARTIAL_CHAIN and VERIFY_X509_STRICT for Python
    3.13+. (#3571)
  * Fixed a bug with partial reads of streaming data in Emscripten.
    (#3555)
  * Switched to uv for installing development dependecies. (#3550)
  * Removed the multiple.intoto.jsonl asset from GitHub releases.
    Attestation of release files since v2.3.0 can be found on PyPI.
    (#3566)
- 2.3.0:
  * Added HTTPResponse.shutdown() to stop any ongoing or future reads
    for a specific response. It calls shutdown(SHUT_RD) on the
    underlying socket. This feature was sponsored by LaunchDarkly.
    (#2868)
  * Added support for JavaScript Promise Integration on Emscripten.
    This enables more efficient WebAssembly requests and streaming,
    and makes it possible to use in Node.js if you launch it as node
    --experimental-wasm-stack-switching. (#3400)
  * Added the proxy_is_tunneling property to HTTPConnection and
    HTTPSConnection. (#3285)
  * Added pickling support to NewConnectionError and
    NameResolutionError. (#3480)
  * Fixed an issue in debug logs where the HTTP version was rendering
    as "HTTP/11" instead of "HTTP/1.1". (#3489)
  * Removed support for Python 3.8. (#3492)

OBS-URL: https://build.opensuse.org/request/show/1280514
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=71
2025-05-31 17:14:11 +00:00
b047ad7493 - Update to 2.4.0
* Applied PEP 639 by specifying the license fields in
    pyproject.toml. (#3522)
  * Updated exceptions to save and restore more properties during the
    pickle/serialization process. (#3567)
  * Added verify_flags option to create_urllib3_context with a default
    of VERIFY_X509_PARTIAL_CHAIN and VERIFY_X509_STRICT for Python
    3.13+. (#3571)
  * Fixed a bug with partial reads of streaming data in Emscripten.
    (#3555)
  * Switched to uv for installing development dependecies. (#3550)
  * Removed the multiple.intoto.jsonl asset from GitHub releases.
    Attestation of release files since v2.3.0 can be found on PyPI.
    (#3566)
- 2.3.0:
  * Added HTTPResponse.shutdown() to stop any ongoing or future reads
    for a specific response. It calls shutdown(SHUT_RD) on the
    underlying socket. This feature was sponsored by LaunchDarkly.
    (#2868)
  * Added support for JavaScript Promise Integration on Emscripten.
    This enables more efficient WebAssembly requests and streaming,
    and makes it possible to use in Node.js if you launch it as node
    --experimental-wasm-stack-switching. (#3400)
  * Added the proxy_is_tunneling property to HTTPConnection and
    HTTPSConnection. (#3285)
  * Added pickling support to NewConnectionError and
    NameResolutionError. (#3480)
  * Fixed an issue in debug logs where the HTTP version was rendering
    as "HTTP/11" instead of "HTTP/1.1". (#3489)
  * Removed support for Python 3.8. (#3492)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=188
2025-05-27 09:29:34 +00:00
2262dc56eb - Skip test_close_after_handshake flaky test, it fails sometimes in
ppc64le and s390x architectures, bsc#1243583

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=187
2025-05-27 08:55:03 +00:00
54eda1f9f2 Accepting request 1232162 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1232162
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=70
2024-12-19 20:40:18 +00:00
69de784631 Accepting request 1232160 from home:dgarcia:branches:devel:languages:python
- Skip some flaky tests that fail sometimes in OBS (bsc#1234681)

OBS-URL: https://build.opensuse.org/request/show/1232160
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=185
2024-12-19 10:26:30 +00:00
a5be242803 Accepting request 1231820 from devel:languages:python
- Ignore DeprecationWarning in tests (bsc#1234681)

OBS-URL: https://build.opensuse.org/request/show/1231820
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=69
2024-12-18 19:09:10 +00:00
88a76d7d5a - Ignore DeprecationWarning in tests (bsc#1234681)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=183
2024-12-18 08:42:44 +00:00
f702af0f5d Accepting request 1205339 from devel:languages:python
- Update to 2.2.3:
  * Features
    + Added support for Python 3.13.
  * Bugfixes
    + Fixed the default encoding of chunked request bodies to be UTF-8
      instead of ISO-8859-1. All other methods of supplying a request body
      already use UTF-8 starting in urllib3 v2.0.
    + Fixed ResourceWarning on CONNECT with Python < 3.11.4 by backporting
      python/cpython#103472.
    + Fixed a crash where certain standard library hash functions were absent
      in restricted environments.
    + Added the Proxy-Authorization header to the list of headers to strip
      from requests when redirecting to a different host. As before,
      different headers can be set via Retry.remove_headers_on_redirect.
    + Allowed passing negative integers as amt to read methods of
      http.client.HTTPResponse as an alternative to None.
    + Fixed issue where InsecureRequestWarning was emitted for HTTPS
      connections when using Emscripten.
    + Fixed HTTPConnectionPool.urlopen to stop automatically casting
      non-proxy headers to HTTPHeaderDict. This change was premature as it
      did not apply to proxy headers and HTTPHeaderDict does not handle byte
      header values correctly yet.
    + Changed InvalidChunkLength to ProtocolError when response terminates
      before the chunk length is sent.
    + Changed ProtocolError to be more verbose on incomplete reads with
      excess content.
    + Added support for HTTPResponse.read1() method.
    + Fixed issue where requests against urls with trailing dots were
      failing due to SSL errors when using proxy.
    + Fixed HTTPConnection.proxy_is_verified and

OBS-URL: https://build.opensuse.org/request/show/1205339
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=68
2024-10-03 16:00:38 +00:00
9687d3e2d5 Fiddle with changelog
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=181
2024-10-03 05:11:07 +00:00
29ba66e58c - Update to 2.2.3:
* Features
    + Added support for Python 3.13.
  * Bugfixes
    + Fixed the default encoding of chunked request bodies to be UTF-8
      instead of ISO-8859-1. All other methods of supplying a request body
      already use UTF-8 starting in urllib3 v2.0.
    + Fixed ResourceWarning on CONNECT with Python < 3.11.4 by backporting
      python/cpython#103472.
    + Fixed a crash where certain standard library hash functions were absent
      in restricted environments.
    + Added the Proxy-Authorization header to the list of headers to strip
      from requests when redirecting to a different host. As before,
      different headers can be set via Retry.remove_headers_on_redirect.
    + Allowed passing negative integers as amt to read methods of
      http.client.HTTPResponse as an alternative to None.
    + Fixed issue where InsecureRequestWarning was emitted for HTTPS
      connections when using Emscripten.
    + Fixed HTTPConnectionPool.urlopen to stop automatically casting
      non-proxy headers to HTTPHeaderDict. This change was premature as it
      did not apply to proxy headers and HTTPHeaderDict does not handle byte
      header values correctly yet.
    + Changed InvalidChunkLength to ProtocolError when response terminates
      before the chunk length is sent.
    + Changed ProtocolError to be more verbose on incomplete reads with
      excess content.
    + Added support for HTTPResponse.read1() method.
    + Fixed issue where requests against urls with trailing dots were
      failing due to SSL errors when using proxy.
    + Fixed HTTPConnection.proxy_is_verified and

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=180
2024-09-24 05:07:08 +00:00
ba032a537b Accepting request 1181456 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1181456
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=67
2024-06-18 20:50:46 +00:00
f36007869a Accepting request 1181452 from home:mcalabkova:branches:devel:languages:python:patch
- Add CVE-2024-37891.patch (bsc#1226469)

OBS-URL: https://build.opensuse.org/request/show/1181452
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=178
2024-06-18 09:56:35 +00:00
3 changed files with 0 additions and 98 deletions

View File

@@ -1,88 +0,0 @@
From f3ef966d0c717099d2f4a1697bd661b48c703efd Mon Sep 17 00:00:00 2001
From: Illia Volochii <illia.volochii@gmail.com>
Date: Wed, 7 Jan 2026 18:07:30 +0200
Subject: [PATCH] Merge commit from fork
* Stop decoding response content during redirects needlessly
* Rename the new query parameter
* Add a changelog entry
---
dummyserver/app.py | 8 +++++++-
src/urllib3/response.py | 6 +++++-
test/with_dummyserver/test_connectionpool.py | 19 +++++++++++++++++++
3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/dummyserver/app.py b/dummyserver/app.py
index 0eeb93f7..5b82e932 100644
--- a/dummyserver/app.py
+++ b/dummyserver/app.py
@@ -233,10 +233,16 @@ async def redirect() -> ResponseReturnValue:
values = await request.values
target = values.get("target", "/")
status = values.get("status", "303 See Other")
+ compressed = values.get("compressed") == "true"
status_code = status.split(" ")[0]
headers = [("Location", target)]
- return await make_response("", status_code, headers)
+ if compressed:
+ headers.append(("Content-Encoding", "gzip"))
+ data = gzip.compress(b"foo")
+ else:
+ data = b""
+ return await make_response(data, status_code, headers)
@hypercorn_app.route("/redirect_after")
diff --git a/src/urllib3/response.py b/src/urllib3/response.py
index 5632dab3..720fbf26 100644
--- a/src/urllib3/response.py
+++ b/src/urllib3/response.py
@@ -677,7 +677,11 @@ class HTTPResponse(BaseHTTPResponse):
Unread data in the HTTPResponse connection blocks the connection from being released back to the pool.
"""
try:
- self.read()
+ self.read(
+ # Do not spend resources decoding the content unless
+ # decoding has already been initiated.
+ decode_content=self._has_decoded_content,
+ )
except (HTTPError, OSError, BaseSSLError, HTTPException):
pass
diff --git a/test/with_dummyserver/test_connectionpool.py b/test/with_dummyserver/test_connectionpool.py
index ce165e24..8d6107ae 100644
--- a/test/with_dummyserver/test_connectionpool.py
+++ b/test/with_dummyserver/test_connectionpool.py
@@ -508,6 +508,25 @@ class TestConnectionPool(HypercornDummyServerTestCase):
assert r.status == 200
assert r.data == b"Dummy server!"
+ @mock.patch("urllib3.response.GzipDecoder.decompress")
+ def test_no_decoding_with_redirect_when_preload_disabled(
+ self, gzip_decompress: mock.MagicMock
+ ) -> None:
+ """
+ Test that urllib3 does not attempt to decode a gzipped redirect
+ response when `preload_content` is set to `False`.
+ """
+ with HTTPConnectionPool(self.host, self.port) as pool:
+ # Three requests are expected: two redirects and one final / 200 OK.
+ response = pool.request(
+ "GET",
+ "/redirect",
+ fields={"target": "/redirect?compressed=true", "compressed": "true"},
+ preload_content=False,
+ )
+ assert response.status == 200
+ gzip_decompress.assert_not_called()
+
def test_303_redirect_makes_request_lose_body(self) -> None:
with HTTPConnectionPool(self.host, self.port) as pool:
response = pool.request(
--
2.52.0

View File

@@ -1,10 +1,3 @@
-------------------------------------------------------------------
Tue Jan 13 09:58:43 UTC 2026 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Add CVE-2026-21441.patch to fix excessive resource consumption
during decompression of data in HTTP redirect responses
(bsc#1256331, CVE-2026-21441)
-------------------------------------------------------------------
Mon Jun 23 02:03:12 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -35,9 +35,6 @@ Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3
# https://github.com/urllib3/urllib3/issues/3334
%define hypercorn_commit d1719f8c1570cbd8e6a3719ffdb14a4d72880abb
Source1: https://github.com/urllib3/hypercorn/archive/%{hypercorn_commit}/hypercorn-%{hypercorn_commit}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/urllib3/urllib3/commit/8864ac407bba8607950025e0979c4c69bc7abc7b
# Stop decoding response content during redirects needlessly (CVE-2026-21441)
Patch1: CVE-2026-21441.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatch-vcs}
BuildRequires: %{python_module hatchling}