import python3.11-urllib3-1.26.12-2.el9_5.1

c9 imports/c9/python3.11-urllib3-1.26.12-2.el9_5.1
MSVSphere Packaging Team 3 months ago
parent 7adeda706c
commit dff15759c1
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

@ -0,0 +1,53 @@
From 2e6a170805a8c2ea675a2a586828d7f5b53e856f Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Fri, 13 Oct 2023 09:29:29 +0200
Subject: [PATCH] CVE-2023-43804
---
src/urllib3/util/retry.py | 2 +-
test/test_retry.py | 2 +-
test/test_retry_deprecated.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/urllib3/util/retry.py b/src/urllib3/util/retry.py
index 3398323..f727602 100644
--- a/src/urllib3/util/retry.py
+++ b/src/urllib3/util/retry.py
@@ -235,7 +235,7 @@ class Retry(object):
RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])
#: Default headers to be used for ``remove_headers_on_redirect``
- DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Authorization"])
+ DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Cookie", "Authorization"])
#: Maximum backoff time.
DEFAULT_BACKOFF_MAX = 120
diff --git a/test/test_retry.py b/test/test_retry.py
index f170e57..d7c216b 100644
--- a/test/test_retry.py
+++ b/test/test_retry.py
@@ -293,7 +293,7 @@ class TestRetry(object):
def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
- assert list(retry.remove_headers_on_redirect) == ["authorization"]
+ assert retry.remove_headers_on_redirect == {"authorization", "cookie"}
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=["X-API-Secret"])
diff --git a/test/test_retry_deprecated.py b/test/test_retry_deprecated.py
index 20e9810..d7905cd 100644
--- a/test/test_retry_deprecated.py
+++ b/test/test_retry_deprecated.py
@@ -295,7 +295,7 @@ class TestRetry(object):
def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
- assert list(retry.remove_headers_on_redirect) == ["authorization"]
+ assert retry.remove_headers_on_redirect == {"authorization", "cookie"}
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=["X-API-Secret"])
--
2.41.0

@ -0,0 +1,66 @@
From b2a4f7903eff44b8151ab5001198dddc7c429c72 Mon Sep 17 00:00:00 2001
From: Quentin Pradet <quentin.pradet@gmail.com>
Date: Wed, 25 Sep 2024 12:58:55 +0200
Subject: [PATCH] Merge pull request from GHSA-34jh-p97f-mpxf
* [1.26] Strip Proxy-Authorization header on redirects
* Set release date
---
src/urllib3/util/retry.py | 4 +++-
test/test_retry.py | 6 +++++-
test/test_retry_deprecated.py | 6 +++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/urllib3/util/retry.py b/src/urllib3/util/retry.py
index f727602..4a6eb0d 100644
--- a/src/urllib3/util/retry.py
+++ b/src/urllib3/util/retry.py
@@ -235,7 +235,9 @@ class Retry(object):
RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])
#: Default headers to be used for ``remove_headers_on_redirect``
- DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Cookie", "Authorization"])
+ DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(
+ ["Cookie", "Authorization", "Proxy-Authorization"]
+ )
#: Maximum backoff time.
DEFAULT_BACKOFF_MAX = 120
diff --git a/test/test_retry.py b/test/test_retry.py
index d7c216b..b23c7d1 100644
--- a/test/test_retry.py
+++ b/test/test_retry.py
@@ -293,7 +293,11 @@ class TestRetry(object):
def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
- assert retry.remove_headers_on_redirect == {"authorization", "cookie"}
+ assert retry.remove_headers_on_redirect == {
+ "authorization",
+ "proxy-authorization",
+ "cookie",
+ }
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=["X-API-Secret"])
diff --git a/test/test_retry_deprecated.py b/test/test_retry_deprecated.py
index d7905cd..0d22b0a 100644
--- a/test/test_retry_deprecated.py
+++ b/test/test_retry_deprecated.py
@@ -295,7 +295,11 @@ class TestRetry(object):
def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
- assert retry.remove_headers_on_redirect == {"authorization", "cookie"}
+ assert retry.remove_headers_on_redirect == {
+ "authorization",
+ "proxy-authorization",
+ "cookie",
+ }
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=["X-API-Secret"])
--
2.46.0

@ -0,0 +1,31 @@
From 00c3895e43305e8fd8394ef74d6466f90afcedb6 Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Mon, 24 Apr 2023 19:10:26 +0100
Subject: [PATCH] Fix test_ssl_object_attributes
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
---
test/test_ssltransport.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/test_ssltransport.py b/test/test_ssltransport.py
index f548e06..fd363a2 100644
--- a/test/test_ssltransport.py
+++ b/test/test_ssltransport.py
@@ -202,8 +202,11 @@ class SingleTLSLayerTestCase(SocketDummyServerTestCase):
assert ssock.selected_npn_protocol() is None
shared_ciphers = ssock.shared_ciphers()
- assert type(shared_ciphers) == list
- assert len(shared_ciphers) > 0
+ # SSLContext.shared_ciphers() changed behavior completely in a patch version.
+ # See: https://github.com/python/cpython/issues/96931
+ assert shared_ciphers is None or (
+ type(shared_ciphers) is list and len(shared_ciphers) > 0
+ )
assert ssock.compression() is None
--
2.46.2

@ -8,7 +8,7 @@
Name: python%{python3_pkgversion}-%{srcname} Name: python%{python3_pkgversion}-%{srcname}
Version: 1.26.12 Version: 1.26.12
Release: 1%{?dist} Release: 2%{?dist}.1
Summary: Python HTTP library with thread-safe connection pooling and file post Summary: Python HTTP library with thread-safe connection pooling and file post
License: MIT License: MIT
@ -16,6 +16,27 @@ URL: https://github.com/urllib3/urllib3
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
# CVE-2023-43804
# Added the `Cookie` 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`.
# Tests backported only partially as we don't use the whole part of
# testing with dummyserver.
# Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=2242493
# Upstream fix: https://github.com/urllib3/urllib3/commit/01220354d389cd05474713f8c982d05c9b17aafb
Patch1: CVE-2023-43804.patch
# CVE-2024-37891
# Proxy-authorization request header is not stripped during cross-origin redirects.
# Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2024-37891
# Upstream fix: https://github.com/urllib3/urllib3/commit/40b6d1605814dd1db0a46e202d6e56f2e4c9a468
Patch2: CVE-2024-37891.patch
# The implementation of ssl.SSLSocket.shared_ciphers has been fixed
# in Python 3.11.3 and that requires a fix for the testsuite.
# Upstream fix: https://github.com/urllib3/urllib3/commit/25cca389496b86ee809c21e5b641aeaa74809263
# CPython change: https://github.com/python/cpython/issues/96931
Patch3: fix_test_ssltransport_py311.patch
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-rpm-macros BuildRequires: python%{python3_pkgversion}-rpm-macros
@ -111,6 +132,14 @@ ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \
%changelog %changelog
* Wed Sep 25 2024 Lumír Balhar <lbalhar@redhat.com> - 1.26.12-2.1
- Security fix for CVE-2024-37891
Resolves: RHEL-59990
* Fri Oct 13 2023 Lumír Balhar <lbalhar@redhat.com> - 1.26.12-2
- Security fix for CVE-2023-43804
Resolves: RHEL-12003
* Tue Nov 29 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.26.12-1 * Tue Nov 29 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.26.12-1
- Initial package - Initial package
- Fedora contributions by: - Fedora contributions by:

Loading…
Cancel
Save