Skip to content

Commit f27ba14

Browse files
[AUTO-CHERRYPICK] Fix CVE-2022-40898 for python-wheel - branch main (#10423)
Co-authored-by: Sudipta Pandit <sudpandit@microsoft.com>
1 parent 31e961b commit f27ba14

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 56341b35080dfa25d28039ff7f0e774a6f56876d Mon Sep 17 00:00:00 2001
2+
From: Sudipta Pandit <sudpandit@microsoft.com>
3+
Date: Fri, 6 Sep 2024 15:31:24 +0530
4+
Subject: [PATCH] [PATCH] Backport upstream patch for CVE-2022-40898
5+
6+
Backported from https://github.com/pypa/wheel/commit/88f02bc335d5404991e532e7f3b0fc80437bf4e0
7+
---
8+
wheel/wheelfile.py | 7 ++++---
9+
1 file changed, 4 insertions(+), 3 deletions(-)
10+
11+
diff --git a/wheel/wheelfile.py b/wheel/wheelfile.py
12+
index ddf8509..ddb753c 100644
13+
--- a/wheel/wheelfile.py
14+
+++ b/wheel/wheelfile.py
15+
@@ -16,9 +16,10 @@ from wheel.util import urlsafe_b64decode, as_unicode, native, urlsafe_b64encode,
16+
# Non-greedy matching of an optional build number may be too clever (more
17+
# invalid wheel filenames will match). Separate regex for .dist-info?
18+
WHEEL_INFO_RE = re.compile(
19+
- r"""^(?P<namever>(?P<name>.+?)-(?P<ver>.+?))(-(?P<build>\d[^-]*))?
20+
- -(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)\.whl$""",
21+
- re.VERBOSE)
22+
+ r"""^(?P<namever>(?P<name>[^-]+?)-(?P<ver>[^-]+?))(-(?P<build>\d[^-]*))?
23+
+ -(?P<pyver>[^-]+?)-(?P<abi>[^-]+?)-(?P<plat>[^.]+?)\.whl$""",
24+
+ re.VERBOSE,
25+
+)
26+
27+
28+
def get_zipinfo_datetime(timestamp=None):
29+
--
30+
2.34.1
31+

SPECS/python-wheel/python-wheel.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
Summary: Built-package format for Python
44
Name: python-%{pypi_name}
55
Version: 0.33.6
6-
Release: 7%{?dist}
6+
Release: 8%{?dist}
77
License: MIT
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
1010
URL: https://github.com/pypa/wheel
1111
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
12+
Patch0: CVE-2022-40898.patch
1213
%global pypi_name wheel
1314
%global python_wheelname %{pypi_name}-%{version}-py2.py3-none-any.whl
1415
%global python_wheeldir %{_datadir}/python-wheels
@@ -102,6 +103,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test3 -v --ignore build
102103
%endif
103104

104105
%changelog
106+
* Fri Sep 09 2024 Sudipta Pandit <sudpandit@microsoft.com> - 0.33.6-8
107+
- Backport CVE-2022-40898 fix from upstream
108+
105109
* Thu Mar 03 2022 Bala <balakumaran.kannan@microsoft.com> - 0.33.6-7
106110
- BR multiple python3 modules for PTest
107111
- pip3 install additional modules which not available as RPM

0 commit comments

Comments
 (0)