From d4a71497c4620cf82985029110d0e858256e99f8 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 1 Oct 2015 20:23:11 -0700 Subject: [PATCH] Misc.last: add a timeout in --regexp search to prevent various ReDoS attacks --- plugins/Misc/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 240fce914..13967aec6 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -455,7 +455,7 @@ class Misc(callbacks.Plugin): def f1(s, arg): """Since we can't enqueue match objects into the multiprocessing queue, 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 else: return False