Class: Brakeman::CheckFilterSkipping

Inherits:
BaseCheck
  • Object
show all
Defined in:
lib/brakeman/checks/check_filter_skipping.rb

Overview

Instance Method Summary collapse

Instance Method Details

#run_checkObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/brakeman/checks/check_filter_skipping.rb', line 10

def run_check
  if version_between?('3.0.0', '3.0.9') and uses_arbitrary_actions?

    warn :warning_type => "Default Routes",
      :warning_code => :CVE_2011_2929,
      :message => msg("Rails versions before 3.0.10 have a vulnerability which allows filters to be bypassed", msg_cve("CVE-2011-2929")),
      :confidence => :high,
      :gem_info => gemfile_or_environment,
      :link_path => "https://groups.google.com/d/topic/rubyonrails-security/NCCsca7TEtY/discussion",
      :cwe_id => [20]
  end
end

#uses_arbitrary_actions?Boolean

Returns:

  • (Boolean)


23
24
25
26
27
28
29
30
31
# File 'lib/brakeman/checks/check_filter_skipping.rb', line 23

def uses_arbitrary_actions?
  tracker.routes.each do |_name, actions|
    if actions.include? :allow_all_actions
      return true
    end
  end

  false
end