Skip to content

Commit 9277311

Browse files
[AUTO-CHERRYPICK] Fix CVE-2024-37891 for python-pip :3.0 - branch 3.0-dev (#11215)
Co-authored-by: KavyaSree2610 <92566732+KavyaSree2610@users.noreply.github.com>
1 parent 173ae04 commit 9277311

4 files changed

Lines changed: 34 additions & 3 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 06d1284366921615eeadcb388ac7c89c3224f1cb Mon Sep 17 00:00:00 2001
2+
From: kavyasree <kkaitepalli@microsoft.com>
3+
Date: Tue, 19 Nov 2024 17:01:29 +0530
4+
Subject: [PATCH] Fix CVE-2024-37891
5+
6+
---
7+
src/pip/_vendor/urllib3/util/retry.py | 4 +++-
8+
1 file changed, 3 insertions(+), 1 deletion(-)
9+
10+
diff --git a/src/pip/_vendor/urllib3/util/retry.py b/src/pip/_vendor/urllib3/util/retry.py
11+
index 60ef6c4..9a1e90d 100644
12+
--- a/src/pip/_vendor/urllib3/util/retry.py
13+
+++ b/src/pip/_vendor/urllib3/util/retry.py
14+
@@ -235,7 +235,9 @@ class Retry(object):
15+
RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])
16+
17+
#: Default headers to be used for ``remove_headers_on_redirect``
18+
- DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Cookie", "Authorization"])
19+
+ DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(
20+
+ ["Cookie", "Authorization", "Proxy-Authorization"]
21+
+ )
22+
23+
#: Maximum backoff time.
24+
DEFAULT_BACKOFF_MAX = 120
25+
--
26+
2.34.1
27+

SPECS/python-pip/python-pip.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ A tool for installing and managing Python packages}
55
Summary: A tool for installing and managing Python packages
66
Name: python-pip
77
Version: 24.2
8-
Release: 1%{?dist}
8+
Release: 2%{?dist}
99
License: MIT AND Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause)
1010
Vendor: Microsoft Corporation
1111
Distribution: Azure Linux
1212
Group: Development/Tools
1313
URL: https://pip.pypa.io/
1414
Source0: https://github.com/pypa/pip/archive/%{version}/%{srcname}-%{version}.tar.gz
15+
Patch0: CVE-2024-37891.patch
1516

1617
BuildArch: noarch
1718

@@ -51,6 +52,9 @@ BuildRequires: python3-wheel
5152
%{python3_sitelib}/pip*
5253

5354
%changelog
55+
* Fri Nov 22 2024 Kavya Sree Kaitepalli <kkaitepalli@microsoft.com> - 24.2-2
56+
- Patch for CVE-2024-37891
57+
5458
* Wed Oct 23 2024 Bala <balakumaran.kannan@microsoft.com> - 24.2.1
5559
- Upgrade to 24.2 for fixing CVE-2024-6345
5660
- Update build and install steps for toml based build

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ python3-magic-5.45-1.azl3.noarch.rpm
547547
python3-markupsafe-2.1.3-1.azl3.aarch64.rpm
548548
python3-newt-0.52.23-1.azl3.aarch64.rpm
549549
python3-packaging-23.2-3.azl3.noarch.rpm
550-
python3-pip-24.2-1.azl3.noarch.rpm
550+
python3-pip-24.2-2.azl3.noarch.rpm
551551
python3-pygments-2.7.4-2.azl3.noarch.rpm
552552
python3-rpm-4.18.2-1.azl3.aarch64.rpm
553553
python3-rpm-generators-14-11.azl3.noarch.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ python3-magic-5.45-1.azl3.noarch.rpm
553553
python3-markupsafe-2.1.3-1.azl3.x86_64.rpm
554554
python3-newt-0.52.23-1.azl3.x86_64.rpm
555555
python3-packaging-23.2-3.azl3.noarch.rpm
556-
python3-pip-24.2-1.azl3.noarch.rpm
556+
python3-pip-24.2-2.azl3.noarch.rpm
557557
python3-pygments-2.7.4-2.azl3.noarch.rpm
558558
python3-rpm-4.18.2-1.azl3.x86_64.rpm
559559
python3-rpm-generators-14-11.azl3.noarch.rpm

0 commit comments

Comments
 (0)