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