Skip to content

Commit 2c89928

Browse files
authored
Merge pull request #11422 from SCH227/patch-1
2 parents eb1b120 + a5f4a9f commit 2c89928

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

news/11418.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Patch non-exploitable ReDoS vulnerability in wheel_file regex

src/pip/_internal/models/wheel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Wheel:
1313
"""A wheel file"""
1414

1515
wheel_file_re = re.compile(
16-
r"""^(?P<namever>(?P<name>.+?)-(?P<ver>.*?))
17-
((-(?P<build>\d[^-]*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
16+
r"""^(?P<namever>(?P<name>[^\s-]+?)-(?P<ver>[^\s-]*?))
17+
((-(?P<build>\d[^-]*?))?-(?P<pyver>[^\s-]+?)-(?P<abi>[^\s-]+?)-(?P<plat>[^\s-]+?)
1818
\.whl|\.dist-info)$""",
1919
re.VERBOSE,
2020
)

0 commit comments

Comments
 (0)