Skip to content

Commit

Permalink
Add remediation advice for command injection warnings (#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
rangerscience authored Jul 4, 2024
1 parent 5ce66e6 commit 7f673cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/warning_types/command_injection/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ There are many ways to run commands in Ruby:

Brakeman will warn on any method like these that uses user input or unsafely interpolates variables.

You can use [`shellescape`](https://apidock.com/ruby/Shellwords/shellescape) to render a variable safe:

`ls #{params[:file].shellescape}`

See [the Ruby Security Guide](http://guides.rubyonrails.org/security.html#command-line-injection) for details.

0 comments on commit 7f673cd

Please sign in to comment.