From 8a4ce64fc0b369c2e37528d73751975283405828 Mon Sep 17 00:00:00 2001 From: shixuantong <1726671442@qq.com> Date: Mon, 16 May 2022 10:31:11 +0800 Subject: [PATCH] fix CVE-2015-20107 --- openEuler-CVE-2015-20107.patch | 43 ++++++++++++++++++++++++++++++++++ python3.spec | 10 +++++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 openEuler-CVE-2015-20107.patch diff --git a/openEuler-CVE-2015-20107.patch b/openEuler-CVE-2015-20107.patch new file mode 100644 index 0000000..136891c --- /dev/null +++ b/openEuler-CVE-2015-20107.patch @@ -0,0 +1,43 @@ +From c7c5f7f272659981f4c6bbfa212257945c86d17c Mon Sep 17 00:00:00 2001 +From: shixuantong +Date: Sat, 14 May 2022 16:50:02 +0800 +Subject: [PATCH] fix CVE-2015-20107 + +--- + Lib/mailcap.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Lib/mailcap.py b/Lib/mailcap.py +index bd0fc09..1ad3dd5 100644 +--- a/Lib/mailcap.py ++++ b/Lib/mailcap.py +@@ -2,6 +2,7 @@ + + import os + import warnings ++from shlex import quote + + __all__ = ["getcaps","findmatch"] + +@@ -203,8 +204,6 @@ def subst(field, MIMEtype, filename, plist=[]): + c = field[i]; i = i+1 + if c == '%': + res = res + c +- elif c == 's': +- res = res + filename + elif c == 't': + res = res + MIMEtype + elif c == '{': +@@ -219,6 +218,9 @@ def subst(field, MIMEtype, filename, plist=[]): + # %F == list of alternating type and filename for parts + else: + res = res + '%' + c ++ res = res.replace("'%s'", quote(filename)) ++ res = res.replace('"%s"',quote(filename)) ++ res = res.replace('%s',quote(filename)) + return res + + def findparam(name, plist): +-- +1.8.3.1 + diff --git a/python3.spec b/python3.spec index 8f71744..6412488 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ Summary: Interpreter of the Python3 programming language URL: https://www.python.org/ Version: 3.9.9 -Release: 7 +Release: 8 License: Python %global branchversion 3.9 @@ -93,6 +93,7 @@ Patch6001: backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch Patch6002: backport-bpo-20369-concurrent.futures.wait-now-deduplicates-f.patch Patch9000: add-the-sm3-method-for-obtaining-the-salt-value.patch +Patch9001: openEuler-CVE-2015-20107.patch Provides: python%{branchversion} = %{version}-%{release} Provides: python(abi) = %{branchversion} @@ -181,6 +182,7 @@ rm -r Modules/expat %patch6002 -p1 %patch9000 -p1 +%patch9001 -p1 rm Lib/ensurepip/_bundled/*.whl rm configure pyconfig.h.in @@ -795,6 +797,12 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP" %{_mandir}/*/* %changelog +* Mon May 16 2022 shixuantong - 3.9.9-8 +- Type:CVE +- CVE:CVE-2015-20107 +- SUG:NA +- DESC:fix CVE-2015-20107 + * Tue Mar 15 2022 BruceGW - 3.9.9-7 - Type:bugfix - CVE:NA -- Gitee