Sha256: 63bfde660422f59527015218c903c2291eafc6058dfd3041d553d1c3dcda8e1b

Contents?: true

Size: 1016 Bytes

Versions: 2

Compression:

Stored size: 1016 Bytes

Contents

require 'railroader/checks/base_check'

# Check for filter skipping vulnerability
# http://groups.google.com/group/rubyonrails-security/browse_thread/thread/3420ac71aed312d6
class Railroader::CheckFilterSkipping < Railroader::BaseCheck
  Railroader::Checks.add self

  @description = "Checks for versions 3.0-3.0.9 which had a vulnerability in filters"

  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 => "Versions before 3.0.10 have a vulnerability which allows filters to be bypassed: CVE-2011-2929",
        :confidence => :high,
        :gem_info => gemfile_or_environment,
        :link_path => "https://groups.google.com/d/topic/rubyonrails-security/NCCsca7TEtY/discussion"
    end
  end

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

    false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
railroader-4.3.8 lib/railroader/checks/check_filter_skipping.rb
railroader-4.3.7 lib/railroader/checks/check_filter_skipping.rb