Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/importlib/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class EntryPoint(

pattern = re.compile(
r'(?P<module>[\w.]+)\s*'
r'(:\s*(?P<attr>[\w.]+))?\s*'
r'(?P<extras>\[.*\])?\s*$'
r'(:\s*(?P<attr>[\w.]+)\s*)?'
r'((?P<extras>\[.*\])\s*)?$'
)
"""
A regular expression describing the syntax for an entry point,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In ``importlib.metadata.EntryPoint.pattern``, avoid potential REDoS by
limiting ambiguity in consecutive whitespace.