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

Command injection warning expected but missed #1197

Closed
JacobEvelyn opened this issue May 7, 2018 · 3 comments · Fixed by #1440
Closed

Command injection warning expected but missed #1197

JacobEvelyn opened this issue May 7, 2018 · 3 comments · Fixed by #1440

Comments

@JacobEvelyn
Copy link
Contributor

Background

Brakeman version: 4.2.1
Rails version: 5.1.6
Ruby version: 2.3.4

Issue

Similar to #1179, I'd expect the following code to produce a command injection warning in brakeman:

def dangerous(foo)
  system("echo " + foo)
end

Would it be possible to get brakeman to transform that into system("echo #{foo}"), similar to your suggested solution for #1179?

@presidentbeef
Copy link
Owner

In this case I'd rather check for string concatenation the way the SQLi check does.

@JacobEvelyn
Copy link
Contributor Author

That works too!

@JacobEvelyn
Copy link
Contributor Author

@presidentbeef any updates on this?

Repository owner locked and limited conversation to collaborators Jan 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants