From 5d5fa553119da2215e7016f2c22f122a9d7606c3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 4 Nov 2022 13:47:53 -0400 Subject: [PATCH] Limit the amount of whitespace to search/backtrack. Fixes #3569. --- setuptools/package_index.py | 2 +- setuptools/tests/test_packageindex.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 5619e4da72c..362e26f3e1a 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -217,7 +217,7 @@ def wrapper(*args, **kwargs): return wrapper -REL = re.compile(r"""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I) +REL = re.compile(r"""<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>""", re.I) """ Regex for an HTML tag with 'rel="val"' attributes. """ diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index e58a8637d11..7b0bf1124dc 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -307,7 +307,6 @@ def test_percent_in_password(self, temp_home): assert cred.password == 'pity%' -@pytest.mark.xfail(reason="#3569") @pytest.mark.timeout(1) def test_REL_DoS(): """