summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3/CVE-2019-20907.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3/CVE-2019-20907.patch')
-rw-r--r--meta/recipes-devtools/python/python3/CVE-2019-20907.patch44
1 files changed, 0 insertions, 44 deletions
diff --git a/meta/recipes-devtools/python/python3/CVE-2019-20907.patch b/meta/recipes-devtools/python/python3/CVE-2019-20907.patch
deleted file mode 100644
index a2e72372dd..0000000000
--- a/meta/recipes-devtools/python/python3/CVE-2019-20907.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From a06a6bf4e67a50561f6d6fb33534df1d3035ea34 Mon Sep 17 00:00:00 2001
2From: Rishi <rishi_devan@mail.com>
3Date: Wed, 15 Jul 2020 13:51:00 +0200
4Subject: [PATCH] bpo-39017: Avoid infinite loop in the tarfile module
5 (GH-21454)
6
7Avoid infinite loop when reading specially crafted TAR files using the tarfile module
8(CVE-2019-20907).
9(cherry picked from commit 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4)
10
11Co-authored-by: Rishi <rishi_devan@mail.com>
12
13Removed testing 'recursion.tar' tar file due to binary data
14
15Upstream-Status: Backport [https://github.com/python/cpython/commit/c55479556db015f48fc8bbca17f64d3e65598559]
16CVE: CVE-2019-20907
17Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
18---
19 Lib/tarfile.py | 2 ++
20 .../2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst | 1 +
21 4 files changed, 10 insertions(+)
22 create mode 100644 Lib/test/recursion.tar
23 create mode 100644 Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst
24
25diff --git a/Lib/tarfile.py b/Lib/tarfile.py
26index d31b9cbb51d65..7a69e1b1aa544 100755
27--- a/Lib/tarfile.py
28+++ b/Lib/tarfile.py
29@@ -1241,6 +1241,8 @@ def _proc_pax(self, tarfile):
30
31 length, keyword = match.groups()
32 length = int(length)
33+ if length == 0:
34+ raise InvalidHeaderError("invalid header")
35 value = buf[match.end(2) + 1:match.start(1) + length - 1]
36
37 # Normally, we could just use "utf-8" as the encoding and "strict"
38diff --git a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst
39new file mode 100644
40index 0000000000000..ad26676f8b856
41--- /dev/null
42+++ b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst
43@@ -0,0 +1 @@
44+Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907).