Sha256: 14fe2a18ea9eaba0f7146b4bec23f3d186237458875241912e6f728ad68141f6

Contents?: true

Size: 968 Bytes

Versions: 19

Compression:

Stored size: 968 Bytes

Contents

require 'brakeman/checks/base_check'

#Check for unsafe manipulation of strings
#Right now this is just a version check for
#https://groups.google.com/group/rubyonrails-security/browse_thread/thread/edd28f1e3d04e913?pli=1
class Brakeman::CheckSafeBufferManipulation < Brakeman::BaseCheck
  Brakeman::Checks.add self

  @description = "Check for Rails versions with SafeBuffer bug"

  def run_check

    if version_between? "3.0.0", "3.0.11"
      suggested_version = "3.0.12"
    elsif version_between? "3.1.0", "3.1.3"
      suggested_version = "3.1.4"
    elsif version_between? "3.2.0", "3.2.1"
      suggested_version = "3.2.2"
    else
      return
    end

    message = "Rails #{tracker.config[:rails_version]} has a vulnerabilty in SafeBuffer. Upgrade to #{suggested_version} or apply patches."

    warn :warning_type => "Cross Site Scripting",
      :message => message,
      :confidence => CONFIDENCE[:med],
      :file => gemfile_or_environment
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
brakeman-1.9.2 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.9.1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.9.0 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.9.0.pre2 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.9.0.pre1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.8.3 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.8.2 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.8.1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.8.0 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.7.1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.7.0 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.6.2 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.6.1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.6.0 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.6.0.pre1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.5.3 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.5.2 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.5.1 lib/brakeman/checks/check_safe_buffer_manipulation.rb
brakeman-1.5.0 lib/brakeman/checks/check_safe_buffer_manipulation.rb