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

Possible ReDoS #61

Closed
mothershipper opened this issue May 11, 2020 · 1 comment
Closed

Possible ReDoS #61

mothershipper opened this issue May 11, 2020 · 1 comment

Comments

@mothershipper
Copy link

User input is turned into a regex and ran against each command name. This can turn into a regex denial-of-service situation if the user can craft a regex with catastrophic backtracking against the current set of commands registered. I haven't found a practical example that starves out hubot in our deployment, but have verified it's possible.

For instance, if you registered a command named "xxxxxxxxxxxxxxxxxxxxxxxxxxg", then sent "(x*)+p", it would trigger the backtracking behavior and freeze up hubot.

cmds = cmds.filter(cmd => cmd.match(new RegExp(filter, 'i')))

Wondering if something like this should be run against the user input, or some validation done (allow only a single wildcard, etc.).

@joeyguerra
Copy link
Member

What if the code used contains instead of a Regex?

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

2 participants