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

Create sanitize_input helper method for strings sent to run_command method. #356

Merged
merged 1 commit into from
Apr 5, 2017

Conversation

xraystyle
Copy link
Contributor

I found that this Sinatra app is vulnerable to shell injection when it runs the commands generated by the :deploy and :deploy_module methods. This patch adds a simple helper method to shell-escape this input, and is called on the strings before they're passed to the above methods. Adds no additional dependencies, Shellwords is part of the Ruby standard library.

@bastelfreak
Copy link
Member

Hey @xraystyle, thanks for the PR! Can you please check the used email address in your commit? It isn't associated with your github account.

@xraystyle
Copy link
Contributor Author

Ah, I haven't set an email address in my git config on my work laptop. Now that I've set it, do I need to re-create the pull request?

@bastelfreak
Copy link
Member

updating the commit + doing a force push is enough.

@xraystyle
Copy link
Contributor Author

Done, should be good now. Author email is one of the emails associated with my github account.

@rnelson0 rnelson0 merged commit f4b44b1 into voxpupuli:master Apr 5, 2017
@rnelson0
Copy link
Member

rnelson0 commented Apr 5, 2017

@xraystyle Great catch here, that's a pretty big security gap. Thank you!

@xraystyle xraystyle deleted the bugfix/shell-escape branch April 5, 2017 22:23
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

Successfully merging this pull request may close these issues.

3 participants