Potential Regex Denial of Service (ReDoS) in ctx_mp
See original GitHub issueType of Issue Potential Regex Denial of Service (ReDoS)
Description The vulnerable regular expression is located in
https://github.com/fredrik-johansson/mpmath/blob/6a675bf08ef285e8b8ec956bcfd03a425b2b6ded/mpmath/ctx_mp.py#L43 https://github.com/fredrik-johansson/mpmath/blob/6a675bf08ef285e8b8ec956bcfd03a425b2b6ded/mpmath/ctx_mp.py#L44
The ReDOS vulnerability of the regex is mainly due to the sub-pattern \d*\.?\d*
with quantified overlapping adjacency and can be exploited with the following string
"(" + "1" * 5000 + "!"
I think you can limit the input length or modify the regex.
I suggest you can repalce the sub-pattern \d*\.?\d*
with \d*(\.\d*)?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Regular expression Denial of Service - ReDoS
This algorithm tries one by one all the possible paths (if needed) until a match is found (or all the paths are tried...
Read more >RegexScalpel: Regular Expression Denial of Service (ReDoS ...
Abstract: The Regular expression Denial of Service (ReDoS) is a class of denial of service attacks that exploit vulnerable regular expressions (regexes) whose ......
Read more >How to protect against regex denial-of-service (ReDoS) attacks
Learn some tips to help you safeguard regular expressions against denial-of-service (DoS) attacks, known as ReDoS attacks.
Read more >The Regular Expression Denial of Service (ReDoS) cheat-sheet
This post is intended as a “technical two-pager” to summarize a security vulnerability called Regex-based Denial of Service (AKA Regex DoS, ...
Read more >Regular Expression Denial of Service (ReDoS) in tmpl | Snyk
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please reopen this issue.
Running https://pypi.org/project/safety currently outputs…
It looks like this was resolved in April 2021, why is the last release from Feburary 2021? Shouldn’t a new version be released that fixes this CVE?