-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Vulnerable Regular Expression in inventory #8175
Copy link
Copy link
Closed
Milestone
Description
Type of Issue
Potential Regex Denial of Service (ReDoS)
Description
The vulnerable regular expression is located in
sphinx/sphinx/util/inventory.py
Line 125 in 31f26a0
| m = re.match(r'(?x)(.+?)\s+(\S*:\S*)\s+(-?\d+)\s+?(\S*)\s+(.*)', |
The ReDOS vulnerability of the regex is mainly due to the sub-patterns (\S*:\S*) and can be exploited with the following string
" " + ":" * 5000
I think you can limit the input length or modify this regex.
Reactions are currently unavailable