Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular Expression DoS vulnerabilities in requests_kerberos/kerberos_.py #152

Closed
yinxiL opened this issue Jun 5, 2020 · 0 comments · Fixed by #164
Closed

Regular Expression DoS vulnerabilities in requests_kerberos/kerberos_.py #152

yinxiL opened this issue Jun 5, 2020 · 0 comments · Fixed by #164

Comments

@yinxiL
Copy link

yinxiL commented Jun 5, 2020

We are working on the ReDoS problem and detected a vulnerable regex from your code.

'(?:.*,)*\s*Negotiate\s*([^,]*),?' in link takes forever to match the string
",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\b"

Please try the below:
python3
import re
re.search(r'(?:.*,)*\s*Negotiate\s*([^,]*),?', ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\b");

We suggest you change the structure (?:.*,)*, to (?:.*).

We didn’t create a pull request because we're not sure if these cases are possible to take place in your program, we also do not understand the functionality of these regexes as you do. Thank you for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant