Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a2bfe6c57 | ||
|
|
8ec67b7f35 |
3 changed files with 58 additions and 2 deletions
|
|
@ -68,6 +68,11 @@ Patch: dummy-certifi.patch
|
||||||
# this warning is juts moot. Also, the warning breaks CPython test suite.
|
# this warning is juts moot. Also, the warning breaks CPython test suite.
|
||||||
Patch: nowarn-pip._internal.main.patch
|
Patch: nowarn-pip._internal.main.patch
|
||||||
|
|
||||||
|
# Patch for the bundled urllib3 for CVE-2025-50181
|
||||||
|
# Redirects are not disabled when retries are disabled on PoolManager instantiation
|
||||||
|
# Upstream fix: https://github.com/urllib3/urllib3/commit/f05b1329126d5be6de501f9d1e3e36738bc08857
|
||||||
|
Patch: urllib3-CVE-2025-50181.patch
|
||||||
|
|
||||||
# Remove -s from Python shebang - ensure that packages installed with pip
|
# Remove -s from Python shebang - ensure that packages installed with pip
|
||||||
# to user locations are seen by pip itself
|
# to user locations are seen by pip itself
|
||||||
%undefine _py3_shebang_s
|
%undefine _py3_shebang_s
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ RPM_BUILD_ROOT=/ /usr/bin/pip install 'Pello==1.0.1'
|
||||||
/usr/bin/pip freeze | grep '^Pello==1\.0\.2$'
|
/usr/bin/pip freeze | grep '^Pello==1\.0\.2$'
|
||||||
|
|
||||||
# Both installations should still exist
|
# Both installations should still exist
|
||||||
test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info"
|
test -d "${RPM_SITELIB}/pello-1.0.1.dist-info"
|
||||||
test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
||||||
|
|
||||||
# Let's ditch the local one
|
# Let's ditch the local one
|
||||||
/usr/bin/pip uninstall --yes Pello
|
/usr/bin/pip uninstall --yes Pello
|
||||||
|
|
||||||
# It should only remove one of them
|
# It should only remove one of them
|
||||||
test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info"
|
test -d "${RPM_SITELIB}/pello-1.0.1.dist-info"
|
||||||
! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
||||||
|
|
||||||
# And pip should still see the RPM-installed one
|
# And pip should still see the RPM-installed one
|
||||||
|
|
|
||||||
51
urllib3-CVE-2025-50181.patch
Normal file
51
urllib3-CVE-2025-50181.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
From b3d543d7e16af844394316360ef1bf0b9d10f1b1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Illia Volochii <illia.volochii@gmail.com>
|
||||||
|
Date: Wed, 18 Jun 2025 16:25:01 +0300
|
||||||
|
Subject: [PATCH] Security fix for CVE-2025-50181
|
||||||
|
|
||||||
|
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
|
||||||
|
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
|
||||||
|
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
|
||||||
|
---
|
||||||
|
src/pip/_vendor/urllib3/poolmanager.py | 18 +++++++++++++++++-
|
||||||
|
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/pip/_vendor/urllib3/poolmanager.py b/src/pip/_vendor/urllib3/poolmanager.py
|
||||||
|
index fb51bf7..a8de7c6 100644
|
||||||
|
--- a/src/pip/_vendor/urllib3/poolmanager.py
|
||||||
|
+++ b/src/pip/_vendor/urllib3/poolmanager.py
|
||||||
|
@@ -170,6 +170,22 @@ class PoolManager(RequestMethods):
|
||||||
|
|
||||||
|
def __init__(self, num_pools=10, headers=None, **connection_pool_kw):
|
||||||
|
RequestMethods.__init__(self, headers)
|
||||||
|
+ if "retries" in connection_pool_kw:
|
||||||
|
+ retries = connection_pool_kw["retries"]
|
||||||
|
+ if not isinstance(retries, Retry):
|
||||||
|
+ # When Retry is initialized, raise_on_redirect is based
|
||||||
|
+ # on a redirect boolean value.
|
||||||
|
+ # But requests made via a pool manager always set
|
||||||
|
+ # redirect to False, and raise_on_redirect always ends
|
||||||
|
+ # up being False consequently.
|
||||||
|
+ # Here we fix the issue by setting raise_on_redirect to
|
||||||
|
+ # a value needed by the pool manager without considering
|
||||||
|
+ # the redirect boolean.
|
||||||
|
+ raise_on_redirect = retries is not False
|
||||||
|
+ retries = Retry.from_int(retries, redirect=False)
|
||||||
|
+ retries.raise_on_redirect = raise_on_redirect
|
||||||
|
+ connection_pool_kw = connection_pool_kw.copy()
|
||||||
|
+ connection_pool_kw["retries"] = retries
|
||||||
|
self.connection_pool_kw = connection_pool_kw
|
||||||
|
self.pools = RecentlyUsedContainer(num_pools)
|
||||||
|
|
||||||
|
@@ -389,7 +405,7 @@ class PoolManager(RequestMethods):
|
||||||
|
kw["body"] = None
|
||||||
|
kw["headers"] = HTTPHeaderDict(kw["headers"])._prepare_for_method_change()
|
||||||
|
|
||||||
|
- retries = kw.get("retries")
|
||||||
|
+ retries = kw.get("retries", response.retries)
|
||||||
|
if not isinstance(retries, Retry):
|
||||||
|
retries = Retry.from_int(retries, redirect=redirect)
|
||||||
|
|
||||||
|
--
|
||||||
|
2.51.0
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue