ackwell / ninjabot

Ninjabot is not 'Just Another Bot'
10 stars 8 forks source link

regex: have a timeout for regex execution #56

Open auscompgeek opened 11 years ago

auscompgeek commented 11 years ago

In its current form, the regex plugin is susceptible to ReDoS (as demonstrated by me on @gnustomp's ninjabot instance). A timeout is needed for the execution of the user-provided regex.

It has been suggested that threading may be used to achieve this.

cyphar commented 11 years ago

@ackwell, does the current codebase use threads for the execution of plugins? Until this happens, we can't do any sleeping of thread, as all execution would halt on the main thread (which we definitely don't want).

ackwell commented 11 years ago

Depends on what the plugin is doing. trigger and on_incoming commands are run inline, timer commands are threaded by Kronos