From be456029e38c019742b3d1d8f4156358c3206596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 2 Jul 2025 08:15:32 +0200 Subject: [PATCH] Security fix for CVE-2025-47273 Resolves: RHEL-101118 --- CVE-2025-47273.patch | 29 +++++++++++++++++++++++++++++ python3.12-setuptools.spec | 12 +++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 CVE-2025-47273.patch diff --git a/CVE-2025-47273.patch b/CVE-2025-47273.patch new file mode 100644 index 0000000..b06b59a --- /dev/null +++ b/CVE-2025-47273.patch @@ -0,0 +1,29 @@ +From 19d6fa7fcb22aef8192dcbc0adb920c12cb6a648 Mon Sep 17 00:00:00 2001 +From: "Jason R. Coombs" +Date: Sat, 19 Apr 2025 13:03:47 -0400 +Subject: [PATCH] Add a check to ensure the name resolves relative to the + tmpdir. + +Closes #4946 +--- + setuptools/package_index.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/setuptools/package_index.py b/setuptools/package_index.py +index f52592a..ebafe9f 100644 +--- a/setuptools/package_index.py ++++ b/setuptools/package_index.py +@@ -828,6 +828,10 @@ class PackageIndex(Environment): + + filename = os.path.join(tmpdir, name) + ++ # ensure path resolves within the tmpdir ++ if not filename.startswith(str(tmpdir)): ++ raise ValueError(f"Invalid filename {filename}") ++ + # Download the file + # + if scheme == 'svn' or scheme.startswith('svn+'): +-- +2.49.0 + diff --git a/python3.12-setuptools.spec b/python3.12-setuptools.spec index 27fe091..379a7d4 100644 --- a/python3.12-setuptools.spec +++ b/python3.12-setuptools.spec @@ -19,7 +19,7 @@ Name: python%{python3_pkgversion}-setuptools # When updating, update the bundled libraries versions bellow! Version: 68.2.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Easily build and distribute Python packages # setuptools is MIT # platformdirs is MIT @@ -49,6 +49,12 @@ Patch: Adjust-the-setup.py-install-deprecation-message.patch # Patch simplified because upstream doesn't support SVN anymore. Patch: CVE-2024-6345.patch +# Security fix for CVE-2025-47273 +# Path traversal in PackageIndex.download leads to Arbitrary File Write +# Upstream solution: https://github.com/pypa/setuptools/pull/4951/ +Patch: CVE-2025-47273.patch + + BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel @@ -226,6 +232,10 @@ PYTHONPATH=$(pwd) %pytest \ %changelog +* Wed Jul 02 2025 Tomáš Hrnčiar - 68.2.2-5 +- Security fix for CVE-2025-47273 +Resolves: RHEL-101118 + * Wed Jul 24 2024 Lumír Balhar - 68.2.2-4 - Security fix for CVE-2024-6345 Resolves: RHEL-49985