-
Notifications
You must be signed in to change notification settings - Fork 734
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
False Positive: command injection when escaped upstream. #1159
Comments
It can also be triggered with ip, mdns, port = [ip,mdns,port].map(&Shellwords.method(:shellescape)) |
Actually, no matter what I do it just flat out claims there could be injection, no matter the type of escaping I do, no matter what I do, it claims there could be injection even though everything is escaped. That's not so nice. |
Hi Jordon, I hope you don't feel like Brakeman is being "mean" for pointing this out! 😢 I agree Brakeman should avoid warning when |
I don't think it was being mean, just confused more than anything, I thought I was doing something wrong at first, and started digging through Ruby's source to see if there was a particular reason (as in was Shellwords not safe.) Thanks for the quick fix! |
Background
Brakeman version: ~> 4.1
Rails version: ~> 5.1
Ruby version: ~> 2.5
Link to Rails application code: No
Issue
When a variable is escaped upstream to a method, Brakeman claims that there could be command injection, even though it's escaped upstream in the initializer.
False Positive
Relevant code:
Why might this be a false positive?
Because it's escaped upstream of the method.
The text was updated successfully, but these errors were encountered: