From c652f34f0a0810acce30431146c4037904990ce0 Mon Sep 17 00:00:00 2001 From: ut005731 Date: Tue, 22 Oct 2024 10:43:45 +0800 Subject: [PATCH] cve:fix CVE-2024-6345 --- CVE-2024-6345.patch | 82 +++++++++++++++++++++++++++++++++++++++++ python3-setuptools.spec | 6 ++- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 CVE-2024-6345.patch diff --git a/CVE-2024-6345.patch b/CVE-2024-6345.patch new file mode 100644 index 0000000..fcb18c5 --- /dev/null +++ b/CVE-2024-6345.patch @@ -0,0 +1,82 @@ +From c60b2467b8809fd1b2ef90d05fbcc529e8db6418 Mon Sep 17 00:00:00 2001 +From: ut005731 +Date: Thu, 26 Sep 2024 10:29:47 +0800 +Subject: [PATCH] test + +--- + setuptools/package_index.py | 23 +++++++++-------------- + 1 file changed, 9 insertions(+), 14 deletions(-) + +diff --git a/setuptools/package_index.py b/setuptools/package_index.py +index b6407be..e14d011 100755 +--- a/setuptools/package_index.py ++++ b/setuptools/package_index.py +@@ -1,4 +1,5 @@ + """PyPI and direct package downloading""" ++import subprocess + import sys + import os + import re +@@ -848,7 +849,7 @@ class PackageIndex(Environment): + + def _download_svn(self, url, filename): + url = url.split('#', 1)[0] # remove any fragment for svn's sake +- creds = '' ++ creds = [] + if url.lower().startswith('svn:') and '@' in url: + scheme, netloc, path, p, q, f = urllib.parse.urlparse(url) + if not netloc and path.startswith('//') and '/' in path[2:]: +@@ -857,14 +858,14 @@ class PackageIndex(Environment): + if auth: + if ':' in auth: + user, pw = auth.split(':', 1) +- creds = " --username=%s --password=%s" % (user, pw) ++ creds = ["--username=" + user, "--password=" + pw] + else: +- creds = " --username=" + auth ++ creds = ["--username=" + auth] + netloc = host + parts = scheme, netloc, url, p, q, f + url = urllib.parse.urlunparse(parts) + self.info("Doing subversion checkout from %s to %s", url, filename) +- os.system("svn checkout%s -q %s %s" % (creds, url, filename)) ++ subprocess.check_call(["svn", "checkout"] + creds + ["-q", url, filename]) + return filename + + @staticmethod +@@ -890,14 +891,11 @@ class PackageIndex(Environment): + url, rev = self._vcs_split_rev_from_url(url, pop_prefix=True) + + self.info("Doing git clone from %s to %s", url, filename) +- os.system("git clone --quiet %s %s" % (url, filename)) ++ subprocess.check_call(["git", "clone", "--quiet", url, filename]) + + if rev is not None: + self.info("Checking out %s", rev) +- os.system("(cd %s && git checkout --quiet %s)" % ( +- filename, +- rev, +- )) ++ subprocess.check_call(["git", "-C", filename, "checkout", "--quiet", rev]) + + return filename + +@@ -906,14 +904,11 @@ class PackageIndex(Environment): + url, rev = self._vcs_split_rev_from_url(url, pop_prefix=True) + + self.info("Doing hg clone from %s to %s", url, filename) +- os.system("hg clone --quiet %s %s" % (url, filename)) ++ subprocess.check_call(["hg", "clone", "--quiet", url, filename]) + + if rev is not None: + self.info("Updating to %s", rev) +- os.system("(cd %s && hg up -C -r %s -q)" % ( +- filename, +- rev, +- )) ++ subprocess.check_call(["hg", "--cwd", filename, "up", "-C", "-r", rev, "-q"]) + + return filename + +-- +2.39.3 diff --git a/python3-setuptools.spec b/python3-setuptools.spec index 7b027de..f86bcd9 100644 --- a/python3-setuptools.spec +++ b/python3-setuptools.spec @@ -16,7 +16,7 @@ Name: python3-setuptools # When updating, update the bundled libraries versions bellow! Version: 39.2.0 -Release: 10%{?dist} +Release: 10%{?dist}.1 Summary: Easily build and distribute Python 3 packages Group: Applications/System @@ -43,6 +43,7 @@ Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{sr # We need to create it if it doesn't exist # https://bugzilla.redhat.com/show_bug.cgi?id=1576924 Patch0: create-site-packages.patch +Patch1: CVE-2024-6345.patch BuildArch: noarch @@ -161,6 +162,9 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore= %changelog +* Fri Sep 20 2024 zhuhongbo - 39.2.0-10.1 +- cve:fix CVE-2024-6345 + * Thu Mar 21 2019 Tomas Orsava - 39.2.0-10 - Add a workaround for a bug in bytecompilation (rhbz#1691402) Resolves: rhbz#1660563 -- Gitee