Skip to content

Commit

Permalink
Fix redos bug around Negotiate expression
Browse files Browse the repository at this point in the history
  • Loading branch information
frozencemetery committed Feb 18, 2020
1 parent c90ea11 commit e8b5393
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions requests_gssapi/gssapi_.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ def _negotiate_value(response):
else:
# There's no need to re-compile this EVERY time it is called. Compile
# it once and you won't have the performance hit of the compilation.
regex = re.compile(r'(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
regex = re.compile(r'Negotiate\s*([^,]*)', re.I)
_negotiate_value.regex = regex

authreq = response.headers.get('www-authenticate', None)

if authreq:
match_obj = regex.search(authreq)
if match_obj:
Expand Down

0 comments on commit e8b5393

Please sign in to comment.