Class: Scanny::Checks::XssFlashCheck

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

Overview

Check for flash methods that are called with request params or dynamic a string. This allows us to avoid showing dangerous HTML code to users

Instance Method Summary collapse

Methods inherited from Check

#compiled_pattern, #issue, #strict?, #visit

Instance Method Details

#check(node) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/scanny/checks/xss/xss_flash_check.rb', line 14

def check(node)
  if Machete.matches?(node, pattern_params)
    issue :high, warning_message, :cwe => 79
  elsif Machete.matches?(node, pattern_dynamic_string)
    issue :medium, warning_message, :cwe => 79
  end
end

#patternObject



7
8
9
10
11
12
# File 'lib/scanny/checks/xss/xss_flash_check.rb', line 7

def pattern
  [
    pattern_params,
    pattern_dynamic_string
  ].join("|")
end