Class: Scanny::Checks::CSRFCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/scanny/checks/csrf_check.rb

Overview

Checks for use of the “protect_from_forgery” method.

Instance Method Summary collapse

Methods inherited from Check

#compiled_pattern, #issue, #visit

Instance Method Details

#check(node) ⇒ Object



10
11
12
# File 'lib/scanny/checks/csrf_check.rb', line 10

def check(node)
  issue :info, "The \"protect_from_forgery\" method is used.", :cwe => 352
end

#patternObject

protect_from_forgery



6
7
8
# File 'lib/scanny/checks/csrf_check.rb', line 6

def pattern
  "Send<receiver = Self, name = :protect_from_forgery>"
end

#strict?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/scanny/checks/csrf_check.rb', line 14

def strict?
  true
end