Title:Remote command injection and SQLi in Ruby Gem brbackup-0.1.1The following code exposes the database password to the command line, if this gem is used in the context of a rails application command injection can be achived by placing shell metacharacters like ; in the user supplied input for variable dbuser. I suspect the other variables are injectable by playing with " and '. Also line 313 is vulnerable to SQL injection via the '#{name}' variable. From: brbackup-0.1.1/lib/brbackup.rb 311- 312- def db_has_myisam?(name) 313- query = "SELECT 1 FROM information_schema.tables WHERE table_schema='#{name}' AND engine='MyISAM' LIMIT 1;" 314: %x{mysql -u #{dbuser} {password_option} -N -e"{query}"}.strip == '1' 315- end 316- 317- def restore_database(name, io) Where password_option will expose the password to the process table if the password is not nil or empty. 338- def password_option 339 dbpass.nil? || dbpass.empty? ? "" : "-p'#{dbpass}'"