Skip to content

Commit

Permalink
Limit the amount of whitespace to search/backtrack. Fixes #3659.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 4, 2022
1 parent 5791343 commit 43a9c9b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion setuptools/package_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
1 change: 0 additions & 1 deletion setuptools/tests/test_packageindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def test_percent_in_password(self, temp_home):
assert cred.password == 'pity%'


@pytest.mark.xfail(reason="#3659")
@pytest.mark.timeout(1)
def test_REL_DoS():
"""
Expand Down

1 comment on commit 43a9c9b

@kijiler23

This comment was marked as off-topic.

Please sign in to comment.