From acfecae8b1c02f9e1c60fd86eedbd287c2041972 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 17 Oct 2019 13:07:27 +0200 Subject: main/python3: security fix for CVE-2019-16935 fixes #10871 --- main/python3/APKBUILD | 8 +++- main/python3/CVE-2019-16935.patch | 80 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 main/python3/CVE-2019-16935.patch diff --git a/main/python3/APKBUILD b/main/python3/APKBUILD index 763fe0d2790..74c115131d7 100644 --- a/main/python3/APKBUILD +++ b/main/python3/APKBUILD @@ -5,7 +5,7 @@ pkgname=python3 # the python2-tkinter's pkgver needs to be synchronized with this. pkgver=3.6.9 _basever="${pkgver%.*}" -pkgrel=1 +pkgrel=2 pkgdesc="A high-level scripting language" url="https://www.python.org" arch="all" @@ -19,10 +19,13 @@ source="https://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz fix-xattrs-glibc.patch musl-find_library.patch CVE-2019-16056.patch + CVE-2019-16935.patch " builddir="$srcdir/Python-$pkgver" # secfixes: +# 3.6.9-r2: +# - CVE-2019-16935 # 3.6.9-r1: # - CVE-2019-16056 # 3.6.8-r1: @@ -159,4 +162,5 @@ wininst() { sha512sums="05de9c6f44d96a52bfce10ede4312de892573edaf8bece65926d19973a3a800d65eed7a857af945f69efcfb25efa3788e7a54016b03d80b611eb51c3ea074819 Python-3.6.9.tar.xz 37b6ee5d0d5de43799316aa111423ba5a666c17dc7f81b04c330f59c1d1565540eac4c585abe2199bbed52ebe7426001edb1c53bd0a17486a2a8e052d0f494ad fix-xattrs-glibc.patch ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch -e8708c4fef1b591dd7251b36a785f9bc6472f2a25fba11bc4116814e93e770230ebd0016285c28d9065c49c5bf2be10f72182e23fb2767e1875ef20c94b5c97c CVE-2019-16056.patch" +e8708c4fef1b591dd7251b36a785f9bc6472f2a25fba11bc4116814e93e770230ebd0016285c28d9065c49c5bf2be10f72182e23fb2767e1875ef20c94b5c97c CVE-2019-16056.patch +7f94d887c81f79d90afd4a9621547c13cbdd0232250f62a686b26a63160a4d286a6db9b342d06b9b63af64f994835b489c37bab499a2093c3c2585dc7a04d8a1 CVE-2019-16935.patch" diff --git a/main/python3/CVE-2019-16935.patch b/main/python3/CVE-2019-16935.patch new file mode 100644 index 00000000000..567eb90fca3 --- /dev/null +++ b/main/python3/CVE-2019-16935.patch @@ -0,0 +1,80 @@ +From 1698cacfb924d1df452e78d11a4bf81ae7777389 Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Sat, 28 Sep 2019 09:33:00 +0200 +Subject: [PATCH] bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) + (GH-16441) + +Escape the server title of xmlrpc.server.DocXMLRPCServer +when rendering the document page as HTML. + +(cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa) +--- + Lib/test/test_docxmlrpc.py | 16 ++++++++++++++++ + Lib/xmlrpc/server.py | 3 ++- + .../2019-09-25-13-21-09.bpo-38243.1pfz24.rst | 3 +++ + 3 files changed, 21 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst + +diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py +index 00903337c07c2..d2adb21af0fb3 100644 +--- a/Lib/test/test_docxmlrpc.py ++++ b/Lib/test/test_docxmlrpc.py +@@ -1,5 +1,6 @@ + from xmlrpc.server import DocXMLRPCServer + import http.client ++import re + import sys + from test import support + threading = support.import_module('threading') +@@ -193,6 +194,21 @@ def test_annotations(self): + b'method_annotation(x: bytes)'), + response.read()) + ++ def test_server_title_escape(self): ++ # bpo-38243: Ensure that the server title and documentation ++ # are escaped for HTML. ++ self.serv.set_server_title('test_title