diff options
| author | Narpat Mali <narpat.mali@windriver.com> | 2023-03-23 21:39:07 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-04 17:46:24 +0100 |
| commit | 79dd246cc5b3b40e8af1a8fe72fad0ee872d4041 (patch) | |
| tree | 392aefc8b62c0290556c1b80c815ad611bee7c93 | |
| parent | a7d90a69d90ac980f28dd1783c2c5a849f6dbdc2 (diff) | |
| download | poky-79dd246cc5b3b40e8af1a8fe72fad0ee872d4041.tar.gz | |
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 [https://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be]
cherry-pick and modify from OE-Core rev: f574d8d57ff3fbc38e350e7a90913993081c4fdf
(From OE-Core rev: f2230ead6c145efc902336b2b9d5a4f0ecb749de)
Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/python/python3-setuptools/0001-Limit-the-amount-of-whitespace-to-search-backtrack.-.patch | 31 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-setuptools_65.0.2.bb | 4 |
2 files changed, 34 insertions, 1 deletions
diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-Limit-the-amount-of-whitespace-to-search-backtrack.-.patch b/meta/recipes-devtools/python/python3-setuptools/0001-Limit-the-amount-of-whitespace-to-search-backtrack.-.patch new file mode 100644 index 0000000000..20a13da7bc --- /dev/null +++ b/meta/recipes-devtools/python/python3-setuptools/0001-Limit-the-amount-of-whitespace-to-search-backtrack.-.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 9e9f617a83f6593b476669030b0347d48e831c3f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Narpat Mali <narpat.mali@windriver.com> | ||
| 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 <narpat.mali@windriver.com> | ||
| 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 | |||
diff --git a/meta/recipes-devtools/python/python3-setuptools_65.0.2.bb b/meta/recipes-devtools/python/python3-setuptools_65.0.2.bb index 1a639ea333..d7cbb99c9d 100644 --- a/meta/recipes-devtools/python/python3-setuptools_65.0.2.bb +++ b/meta/recipes-devtools/python/python3-setuptools_65.0.2.bb | |||
| @@ -9,7 +9,9 @@ inherit pypi python_setuptools_build_meta | |||
| 9 | SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" | 9 | SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" |
| 10 | 10 | ||
| 11 | SRC_URI += "file://0001-change-shebang-to-python3.patch \ | 11 | SRC_URI += "file://0001-change-shebang-to-python3.patch \ |
| 12 | file://0001-_distutils-sysconfig.py-make-it-possible-to-substite.patch" | 12 | file://0001-_distutils-sysconfig.py-make-it-possible-to-substite.patch \ |
| 13 | file://0001-Limit-the-amount-of-whitespace-to-search-backtrack.-.patch \ | ||
| 14 | " | ||
| 13 | 15 | ||
| 14 | SRC_URI[sha256sum] = "101bf15ca723beef42c8db91a761f3748d4d697e17fae904db60c0b619d8d094" | 16 | SRC_URI[sha256sum] = "101bf15ca723beef42c8db91a761f3748d4d697e17fae904db60c0b619d8d094" |
| 15 | 17 | ||
