mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 11:04:05 +01:00
Misc.last: add a timeout in --regexp search to prevent various ReDoS attacks
This commit is contained in:
parent
b64926814b
commit
d4a71497c4
@ -455,7 +455,7 @@ class Misc(callbacks.Plugin):
|
|||||||
def f1(s, arg):
|
def f1(s, arg):
|
||||||
"""Since we can't enqueue match objects into the multiprocessing queue,
|
"""Since we can't enqueue match objects into the multiprocessing queue,
|
||||||
we'll just wrap the function to return bools."""
|
we'll just wrap the function to return bools."""
|
||||||
if arg.search(s) is not None:
|
if process(arg.search, s, timeout=0.1) is not None:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user