Class: Spektr::Checks::I18nXss

Inherits:
Base
  • Object
show all
Defined in:
lib/spektr/checks/i18n_xss.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#app_version_between?, #dupe?, #model_attribute?, #should_run?, #target_affected?, #user_input?, #version_affected, #version_between?, #warn!

Constructor Details

#initialize(app, target) ⇒ I18nXss

Returns a new instance of I18nXss.



5
6
7
8
9
10
# File 'lib/spektr/checks/i18n_xss.rb', line 5

def initialize(app, target)
  super
  @name = "XSS in i18n (CVE-2013-4491)"
  @type = "Cross-Site Scripting"
  @targets = ["Spektr::Targets::Base"]
end

Instance Method Details

#runObject



12
13
14
15
16
17
# File 'lib/spektr/checks/i18n_xss.rb', line 12

def run
  return unless super
  if app_version_between?("3.0.6", "3.2.15") || app_version_between?("4.0.0", "4.0.1")
    warn! "root", self, nil, "I18n has a Cross-Site Scripting vulnerability (CVE_2013_4491)"
  end
end