From 3ca59d6cf2f34584715b40104453b13cd4324088 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Dec 21 2020 08:13:08 +0000 Subject: import python3-3.6.8-34.el8 --- diff --git a/SOURCES/00355-CVE-2020-27619.patch b/SOURCES/00355-CVE-2020-27619.patch new file mode 100644 index 0000000..6a4082d --- /dev/null +++ b/SOURCES/00355-CVE-2020-27619.patch @@ -0,0 +1,42 @@ +diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py +index f9884c6..98feec2 100644 +--- a/Lib/test/multibytecodec_support.py ++++ b/Lib/test/multibytecodec_support.py +@@ -300,29 +300,23 @@ class TestBase_Mapping(unittest.TestCase): + self._test_mapping_file_plain() + + def _test_mapping_file_plain(self): +- unichrs = lambda s: ''.join(map(chr, map(eval, s.split('+')))) ++ def unichrs(s): ++ return ''.join(chr(int(x, 16)) for x in s.split('+')) ++ + urt_wa = {} + + with self.open_mapping_file() as f: + for line in f: + if not line: + break +- data = line.split('#')[0].strip().split() ++ data = line.split('#')[0].split() + if len(data) != 2: + continue + +- csetval = eval(data[0]) +- if csetval <= 0x7F: +- csetch = bytes([csetval & 0xff]) +- elif csetval >= 0x1000000: +- csetch = bytes([(csetval >> 24), ((csetval >> 16) & 0xff), +- ((csetval >> 8) & 0xff), (csetval & 0xff)]) +- elif csetval >= 0x10000: +- csetch = bytes([(csetval >> 16), ((csetval >> 8) & 0xff), +- (csetval & 0xff)]) +- elif csetval >= 0x100: +- csetch = bytes([(csetval >> 8), (csetval & 0xff)]) +- else: ++ if data[0][:2] != '0x': ++ self.fail(f"Invalid line: {line!r}") ++ csetch = bytes.fromhex(data[0][2:]) ++ if len(csetch) == 1 and 0x80 <= csetch[0]: + continue + + unich = unichrs(data[1]) diff --git a/SPECS/python3.spec b/SPECS/python3.spec index a9106a7..f956b75 100644 --- a/SPECS/python3.spec +++ b/SPECS/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.8 -Release: 33%{?dist} +Release: 34%{?dist} License: Python @@ -568,6 +568,11 @@ Patch353: 00353-architecture-names-upstream-downstream.patch # Fixed ustream: https://bugs.python.org/issue39603 Patch354: 00354-cve-2020-26116-http-request-method-crlf-injection-in-httplib.patch +# 00355 # +# No longer call eval() on content received via HTTP in the CJK codec tests +# Fixed upstream: https://bugs.python.org/issue41944 +Patch355: 00355-CVE-2020-27619.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -884,13 +889,14 @@ rm Lib/ensurepip/_bundled/*.whl %patch344 -p1 %patch345 -p1 %patch346 -p1 -%patch353 -p1 -%patch354 -p1 # Patch 351 adds binary file for testing. We need to apply it using Git. git apply %{PATCH351} %patch352 -p1 +%patch353 -p1 +%patch354 -p1 +%patch355 -p1 # Remove files that should be generated by the build # (This is after patching, so that we can use patches directly from upstream) @@ -1816,6 +1822,10 @@ fi # ====================================================== %changelog +* Fri Dec 04 2020 Charalampos Stratakis - 3.6.8-34 +- Security fix for CVE-2020-27619: eval() call on content received via HTTP in the CJK codec tests +Resolves: rhbz#1890237 + * Tue Nov 24 2020 Lumír Balhar - 3.6.8-33 - Add support for upstream architecture names https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names