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

Correction plugin is prone to regex denial of service #99

Closed
ius opened this issue Feb 22, 2015 · 3 comments
Closed

Correction plugin is prone to regex denial of service #99

ius opened this issue Feb 22, 2015 · 3 comments

Comments

@ius
Copy link

ius commented Feb 22, 2015

The correction.py plugin uses regular expressions to match (and replace) user-supplied input.

A malicious user can use a complex regular expression to consume excessive resources and cause the bot to become unresponsive, eventually disconnecting from the network.

Proof of concept:
s/(.+)+x//

Simplifying the correction plugin to only support simple, non-regex replacements is the most obvious solution.

Reference: https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS

@dmptrluke
Copy link
Member

Pinging the creator, @nasonfish

@nasonfish
Copy link
Member

A temporary fix for this was pushed here: http://git.io/Aa9D and I'll look into a better fix so we still have some tools that can be useful for corrections that come with regular expressions.

@Red-M
Copy link
Contributor

Red-M commented Jun 23, 2015

I'd recommend that we take a page from @lahwran and use google apps to do the replacement and still allow the option to do it locally via either unsafe regex or with the current method.

AKA add configuration options to allow for a selection on how to do it whether it be by google app engines, local regex or the current method that is in cloudbot right now.

EDIT: when you use local regex we should also display a warning to the console along with the reason why (link to stakexchange or other similar site showing the issue).
For when we send to google apps display a console message saying that we are sending lines to google to do the regex processing.
Basically do full disclosure of the issue and let the bot owner make the choice on how it operates for the time being until we get @lukeroge to make a multiprocessing sandbox for the regex replacement or soemthing else.

linuxdaemon pushed a commit to linuxdaemon/CloudBot that referenced this issue Mar 12, 2017
linuxdaemon pushed a commit to linuxdaemon/CloudBot that referenced this issue Dec 7, 2017
…k-clean

Add commands for cleaning up user data in chan_track.py
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

No branches or pull requests

4 participants