Skip to content

Commit 92b150b

Browse files
Narpat Malirpurdie
Narpat Mali
authored andcommitted
python3-setuptools: fix for CVE-2022-40897
Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page. There is a Regular Expression Denial of Service (ReDoS) in package_index.py. CVE: CVE-2022-40897 Upstream-Status: Backport [pypa/setuptools@43a9c9b] (From OE-Core rev: f574d8d57ff3fbc38e350e7a90913993081c4fdf) Signed-off-by: Narpat Mali <[email protected]> Signed-off-by: Steve Sakoman <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent da271d7 commit 92b150b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 9e9f617a83f6593b476669030b0347d48e831c3f Mon Sep 17 00:00:00 2001
2+
From: Narpat Mali <[email protected]>
3+
Date: Mon, 9 Jan 2023 14:45:05 +0000
4+
Subject: [PATCH] Limit the amount of whitespace to search/backtrack. Fixes
5+
#3659.
6+
7+
CVE: CVE-2022-40897
8+
9+
Upstream-Status: Backport [https://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be]
10+
11+
Signed-off-by: Narpat Mali <[email protected]>
12+
---
13+
setuptools/package_index.py | 2 +-
14+
1 file changed, 1 insertion(+), 1 deletion(-)
15+
16+
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
17+
index 270e7f3..e93fcc6 100644
18+
--- a/setuptools/package_index.py
19+
+++ b/setuptools/package_index.py
20+
@@ -197,7 +197,7 @@ def unique_values(func):
21+
return wrapper
22+
23+
24+
-REL = re.compile(r"""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I)
25+
+REL = re.compile(r"""<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>""", re.I)
26+
# this line is here to fix emacs' cruddy broken syntax highlighting
27+
28+
29+
--
30+
2.34.1
31+

meta/recipes-devtools/python/python3-setuptools_59.5.0.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-e
1111
SRC_URI += "\
1212
file://0001-change-shebang-to-python3.patch \
1313
file://0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch \
14+
file://0001-Limit-the-amount-of-whitespace-to-search-backtrack.-.patch \
1415
"
1516

1617
SRC_URI[sha256sum] = "d144f85102f999444d06f9c0e8c737fd0194f10f2f7e5fdb77573f6e2fa4fad0"

0 commit comments

Comments
 (0)