Sha256: d77ea78bea17355a7442883afc8abd7c8aa063e048a131c00a68e1ed9692e740

Contents?: true

Size: 870 Bytes

Versions: 35

Compression:

Stored size: 870 Bytes

Contents

require 'brakeman/checks/base_check'

#Check for versions with vulnerable html escape method
#http://groups.google.com/group/rubyonrails-security/browse_thread/thread/56bffb5923ab1195
class Brakeman::CheckEscapeFunction < Brakeman::BaseCheck
  Brakeman::Checks.add self

  @description = "Checks for versions before 2.3.14 which have a vulnerable escape method"

  def run_check
    if version_between?('2.0.0', '2.3.13') and RUBY_VERSION < '1.9.0' 

      warn :warning_type => 'Cross Site Scripting',
        :warning_code => :CVE_2011_2931,
        :message => 'Versions before 2.3.14 have a vulnerability in escape method when used with Ruby 1.8: CVE-2011-2931',
        :confidence => CONFIDENCE[:high],
        :file => gemfile_or_environment,
        :link_path => "https://groups.google.com/d/topic/rubyonrails-security/Vr_7WSOrEZU/discussion"
    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
brakeman-2.6.3 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.6.3 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.6.2 lib/brakeman/checks/check_escape_function.rb
brakeman-2.6.2 lib/brakeman/checks/check_escape_function.rb
brakeman-2.6.1 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.6.1 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.6.0 lib/brakeman/checks/check_escape_function.rb
brakeman-2.6.0 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.5.0 lib/brakeman/checks/check_escape_function.rb
brakeman-2.5.0 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.4.3 lib/brakeman/checks/check_escape_function.rb
brakeman-2.4.3 lib/brakeman/checks/check_escape_function.rb
brakeman-2.4.2 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.4.2 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.4.1 lib/brakeman/checks/check_escape_function.rb
brakeman-2.4.1 lib/brakeman/checks/check_escape_function.rb
brakeman-2.4.0 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.4.0 lib/brakeman/checks/check_escape_function.rb
brakeman-min-2.3.1 lib/brakeman/checks/check_escape_function.rb
brakeman-2.3.1 lib/brakeman/checks/check_escape_function.rb