Skip to content

Instantly share code, notes, and snippets.

View jjeffers's full-sized avatar

James Jeffers jjeffers

View GitHub Profile
Spec::Runner.configure do |config|
config.include Capybara::DSL
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/test/fixtures/'
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
https://gist.github.com/jjeffers/23b19e36482557f62576
| High | User | send_user_message | Command Injection | Possible command injection near l>>
| High | User | User.create_user | Command Injection | Possible command injection near l>>
| High | User | User.tidy_up | Command Injection | Possible command injection near l>>
system(cmd)
logger.info %x[#{cmd}]
cmd = "ls -al #{params[:user_id]}"
logger.info %x[#{cmd}]
ls -al | rm -rf /
system(cmd, arg1, ...)
stdin, stdout, stderr = Open3.popen3(cmd, args)
logger.info stdout
gem install brakeman
brakeman