11Summary: Virtual Python Environment builder
22Name: python-virtualenv
33Version: 20.36.1
4- Release: 1 %{?dist }
4+ Release: 2 %{?dist }
55License: MIT
66Vendor: Microsoft Corporation
77Distribution: Azure Linux
88Group: Development/Languages/Python
99URL: https://pypi.python.org/pypi/virtualenv
1010Source0: https://files.pythonhosted.org/packages/aa/a3/4d310fa5f00863544e1d0f4de93bddec248499ccf97d4791bc3122c9d4f3/virtualenv-20.36.1.tar.gz
1111Patch0: 0001-replace-to-flit.patch
12+ Patch1000: CVE-2025-50181.patch
13+ Patch1001: CVE-2026-1703v0.patch
14+ Patch1002: CVE-2026-1703v1.patch
15+ Patch1003: CVE-2026-24049v0.patch
16+ Patch1004: CVE-2026-24049v1.patch
1217BuildArch: noarch
1318
1419%description
@@ -20,6 +25,7 @@ BuildRequires: python3-devel
2025BuildRequires: python3-setuptools_scm
2126BuildRequires: python3-xml
2227BuildRequires: python3-wheel
28+ BuildRequires: zip
2329
2430%if 0%{?with_check }
2531BuildRequires: python3-pip
@@ -37,7 +43,77 @@ Provides: %{name}-doc = %{version}-%{release}
3743virtualenv is a tool to create isolated Python environment.
3844
3945%prep
40- %autosetup -p1 -n virtualenv-%{version }
46+ # Adding -N to enable manual patching, needed for CVE-2025-50181
47+ %autosetup -p1 -n virtualenv-%{version } -N
48+ %patch -P 0 -p1
49+
50+ # Manual patching for CVE-2025-50181 and CVE-2026-1703v0
51+ # For CVE-2025-50181, poolmanager.py file is located in 2 different places and each is of different version so the same patch cannot be applied to all of them.
52+ # For CVE-2026-1703, unpacking.py file is located in 2 different places and each is of different version so the same patch cannot be applied to all of them.
53+ # Affected files are under src and archived inside a .whl file, so we need to unpack it, apply the patch, and then re-zip it.
54+
55+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/pip-25.0.1-py3-none-any.whl/pip/_vendor/urllib3/poolmanager.py"
56+ mkdir -p unpacked_pip-25.0.1-py3-none-any
57+ unzip src/virtualenv/seed/wheels/embed/pip-25.0.1-py3-none-any.whl -d unpacked_pip-25.0.1-py3-none-any
58+ patch -p1 -d unpacked_pip-25.0.1-py3-none-any < %{PATCH1000 }
59+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/pip-25.0.1-py3-none-any.whl/pip/_internal/utils/unpacking.py"
60+ patch -p1 -d unpacked_pip-25.0.1-py3-none-any < %{PATCH1001 }
61+ # Remove the original file
62+ rm -f src/virtualenv/seed/wheels/embed/pip-25.0.1-py3-none-any.whl
63+ # After patching, re-zip the contents back into a .whl
64+ pushd unpacked_pip-25.0.1-py3-none-any
65+ zip -r ../src/virtualenv/seed/wheels/embed/pip-25.0.1-py3-none-any.whl *
66+ popd
67+ rm -rf unpacked_pip-25.0.1-py3-none-any
68+
69+ # Manual patching for CVE-2025-50181 and CVE-2026-1703v1
70+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/pip-25.3-py3-none-any.whl/pip/_vendor/urllib3/poolmanager.py"
71+ mkdir -p unpacked_pip-25.3-py3-none-any
72+ unzip src/virtualenv/seed/wheels/embed/pip-25.3-py3-none-any.whl -d unpacked_pip-25.3-py3-none-any
73+ patch -p1 -d unpacked_pip-25.3-py3-none-any < %{PATCH1000 }
74+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/pip-25.3-py3-none-any.whl/pip/_internal/utils/unpacking.py"
75+ patch -p1 -d unpacked_pip-25.3-py3-none-any < %{PATCH1002 }
76+ rm -f src/virtualenv/seed/wheels/embed/pip-25.3-py3-none-any.whl
77+ pushd unpacked_pip-25.3-py3-none-any
78+ zip -r ../src/virtualenv/seed/wheels/embed/pip-25.3-py3-none-any.whl *
79+ popd
80+ rm -rf unpacked_pip-25.3-py3-none-any
81+
82+ # Manual patching for CVE-2026-24049v0
83+ # For CVE-2026-24049, unpack.py file is located in 3 different places and each is of different version so the same patch cannot be applied to all of them.
84+ # Affected files are under src and archived inside a .whl file, so we need to unpack it, apply the patch, and then re-zip it.
85+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/setuptools-75.3.2-py3-none-any.whl/setuptools/_vendor/wheel/cli/unpack.py"
86+ mkdir -p unpacked_setuptools-75.3.2-py3-none-any
87+ unzip src/virtualenv/seed/wheels/embed/setuptools-75.3.2-py3-none-any.whl -d unpacked_setuptools-75.3.2-py3-none-any
88+ patch -p1 -d unpacked_setuptools-75.3.2-py3-none-any < %{PATCH1003 }
89+ rm -f src/virtualenv/seed/wheels/embed/setuptools-75.3.2-py3-none-any.whl
90+ pushd unpacked_setuptools-75.3.2-py3-none-any
91+ zip -r ../src/virtualenv/seed/wheels/embed/setuptools-75.3.2-py3-none-any.whl *
92+ popd
93+ rm -rf unpacked_setuptools-75.3.2-py3-none-any
94+
95+ # Manual patching for CVE-2026-24049v0
96+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/setuptools-80.9.0-py3-none-any.whl/setuptools/_vendor/wheel/cli/unpack.py"
97+ mkdir -p unpacked_setuptools-80.9.0-py3-none-any
98+ unzip src/virtualenv/seed/wheels/embed/setuptools-80.9.0-py3-none-any.whl -d unpacked_setuptools-80.9.0-py3-none-any
99+ patch -p1 -d unpacked_setuptools-80.9.0-py3-none-any < %{PATCH1003 }
100+ rm -f src/virtualenv/seed/wheels/embed/setuptools-80.9.0-py3-none-any.whl
101+ pushd unpacked_setuptools-80.9.0-py3-none-any
102+ zip -r ../src/virtualenv/seed/wheels/embed/setuptools-80.9.0-py3-none-any.whl *
103+ popd
104+ rm -rf unpacked_setuptools-80.9.0-py3-none-any
105+
106+ # Manual patching for CVE-2026-24049v1
107+ echo "Manually Patching virtualenv-20.36.1/src/virtualenv/seed/wheels/embed/unpacked_wheel-0.45.1-py3-none-any.whl/wheel/cli/unpack.py"
108+ mkdir -p unpacked_wheel-0.45.1-py3-none-any
109+ unzip src/virtualenv/seed/wheels/embed/wheel-0.45.1-py3-none-any.whl -d unpacked_wheel-0.45.1-py3-none-any
110+ patch -p1 -d unpacked_wheel-0.45.1-py3-none-any < %{PATCH1004 }
111+ rm -f src/virtualenv/seed/wheels/embed/wheel-0.45.1-py3-none-any.whl
112+ pushd unpacked_wheel-0.45.1-py3-none-any
113+ zip -r ../src/virtualenv/seed/wheels/embed/unpacked_wheel-0.45.1-py3-none-any.whl *
114+ popd
115+ rm -rf unpacked_wheel-0.45.1-py3-none-any
116+
41117
42118%generate_buildrequires
43119
@@ -60,6 +136,9 @@ tox -e py
60136%{_bindir }/virtualenv
61137
62138%changelog
139+ * Mon Feb 23 2026 BinduSri Adabala <v-badabala@microsoft.com> - 20.36.1-2
140+ - Patch for CVE-2025-50181, CVE-2026-24049 and CVE-2026-1703
141+
63142* Wed Jan 14 2026 Archana Shettigar <v-shettigara@microsoft.com> - 20.36.1-1
64143- Upgrade to 20.36.1 for CVE-2026-22702
65144
0 commit comments