Sha256: cab0581b82271f7db6a9b47bc9d9586d47ed34b0eebc24ca9d884a7a588cffa1
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require 'checks/base_check' require 'processors/lib/find_call' #Check for vulnerability in translate() helper that allows cross-site scripting #http://groups.google.com/group/rubyonrails-security/browse_thread/thread/2b61d70fb73c7cc5 class CheckTranslateBug < BaseCheck Checks.add self def run_check if (version_between?('2.3.0', '2.3.99') and OPTIONS[:escape_html]) or version_between?('3.0.0', '3.0.10') or version_between?('3.1.0', '3.1.1') if uses_translate? confidence = CONFIDENCE[:high] else confidence = CONFIDENCE[:med] end version = tracker.config[:rails_version] if version =~ /^3\.1/ message = "Versions before 3.1.2 have a vulnerability in the translate helper." elsif version =~ /^3\.0/ message = "Versions before 3.0.11 have a vulnerability in translate helper." else message = "Rails 2.3.x using the rails_xss plugin have a vulnerability in translate helper." end warn :warning_type => "Cross Site Scripting", :message => message, :confidence => confidence, :file => gemfile_or_environment end end def uses_translate? not tracker.find_call([], [:t, :translate]).empty? end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
brakeman-0.9.2 | lib/checks/check_translate_bug.rb |