brakeman 4.10.0 → 5.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +10 -0
  3. data/README.md +1 -1
  4. data/bundle/load.rb +8 -8
  5. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/CHANGELOG.md +9 -0
  6. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/FAQ.md +0 -0
  7. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/Gemfile +1 -4
  8. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/MIT-LICENSE +0 -0
  9. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/README.md +2 -3
  10. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/REFERENCE.md +20 -2
  11. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/TODO +0 -0
  12. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/haml.gemspec +2 -1
  13. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml.rb +0 -0
  14. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/attribute_builder.rb +3 -3
  15. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/attribute_compiler.rb +42 -31
  16. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/attribute_parser.rb +0 -0
  17. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/buffer.rb +0 -0
  18. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/compiler.rb +0 -0
  19. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/engine.rb +0 -0
  20. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/error.rb +0 -0
  21. data/bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/escapable.rb +77 -0
  22. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/exec.rb +0 -0
  23. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/filters.rb +0 -0
  24. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/generator.rb +0 -0
  25. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers.rb +7 -1
  26. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers/action_view_extensions.rb +0 -0
  27. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers/action_view_mods.rb +0 -0
  28. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers/action_view_xss_mods.rb +0 -0
  29. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers/safe_erubi_template.rb +0 -0
  30. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers/safe_erubis_template.rb +0 -0
  31. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/helpers/xss_mods.rb +6 -3
  32. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/options.rb +0 -0
  33. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/parser.rb +1 -1
  34. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/plugin.rb +0 -0
  35. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/railtie.rb +0 -0
  36. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/sass_rails_filter.rb +0 -0
  37. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/template.rb +0 -0
  38. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/template/options.rb +0 -0
  39. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/temple_engine.rb +0 -0
  40. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/temple_line_counter.rb +0 -0
  41. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/util.rb +0 -0
  42. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/lib/haml/version.rb +1 -1
  43. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/yard/default/fulldoc/html/css/common.sass +0 -0
  44. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.0}/yard/default/layout/html/footer.erb +0 -0
  45. data/lib/brakeman.rb +6 -0
  46. data/lib/brakeman/app_tree.rb +36 -3
  47. data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +68 -0
  48. data/lib/brakeman/checks/check_verb_confusion.rb +75 -0
  49. data/lib/brakeman/file_parser.rb +19 -18
  50. data/lib/brakeman/options.rb +5 -1
  51. data/lib/brakeman/parsers/template_parser.rb +2 -3
  52. data/lib/brakeman/processors/haml_template_processor.rb +8 -1
  53. data/lib/brakeman/processors/lib/file_type_detector.rb +64 -0
  54. data/lib/brakeman/report.rb +8 -0
  55. data/lib/brakeman/report/report_sonar.rb +38 -0
  56. data/lib/brakeman/rescanner.rb +7 -5
  57. data/lib/brakeman/scanner.rb +42 -18
  58. data/lib/brakeman/tracker.rb +6 -0
  59. data/lib/brakeman/util.rb +7 -2
  60. data/lib/brakeman/version.rb +1 -1
  61. data/lib/brakeman/warning_codes.rb +2 -0
  62. metadata +49 -45
  63. data/bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/escapable.rb +0 -50
@@ -0,0 +1,64 @@
1
+ module Brakeman
2
+ class FileTypeDetector < BaseProcessor
3
+ def initialize
4
+ super(nil)
5
+ reset
6
+ end
7
+
8
+ def detect_type(file)
9
+ reset
10
+ process(file.ast)
11
+
12
+ if @file_type.nil?
13
+ @file_type = guess_from_path(file.path.relative)
14
+ end
15
+
16
+ @file_type || :libs
17
+ end
18
+
19
+ MODEL_CLASSES = [
20
+ :'ActiveRecord::Base',
21
+ :ApplicationRecord
22
+ ]
23
+
24
+ def process_class exp
25
+ name = class_name(exp.class_name)
26
+ parent = class_name(exp.parent_name)
27
+
28
+ if name.match(/Controller$/)
29
+ @file_type = :controllers
30
+ return exp
31
+ elsif MODEL_CLASSES.include? parent
32
+ @file_type = :models
33
+ return exp
34
+ end
35
+
36
+ super
37
+ end
38
+
39
+ def guess_from_path path
40
+ case
41
+ when path.include?('app/models')
42
+ :models
43
+ when path.include?('app/controllers')
44
+ :controllers
45
+ when path.include?('config/initializers')
46
+ :initializers
47
+ when path.include?('lib/')
48
+ :libs
49
+ when path.match?(%r{config/environments/(?!production\.rb)$})
50
+ :skip
51
+ when path.match?(%r{environments/production\.rb$})
52
+ :skip
53
+ when path.match?(%r{application\.rb$})
54
+ :skip
55
+ end
56
+ end
57
+
58
+ private
59
+
60
+ def reset
61
+ @file_type = nil
62
+ end
63
+ end
64
+ end
@@ -45,6 +45,9 @@ class Brakeman::Report
45
45
  Brakeman::Report::JUnit
46
46
  when :to_sarif
47
47
  return self.to_sarif
48
+ when :to_sonar
49
+ require_report 'sonar'
50
+ Brakeman::Report::Sonar
48
51
  else
49
52
  raise "Invalid format: #{format}. Should be one of #{VALID_FORMATS.inspect}"
50
53
  end
@@ -69,6 +72,11 @@ class Brakeman::Report
69
72
  generate Brakeman::Report::JSON
70
73
  end
71
74
 
75
+ def to_sonar
76
+ require_report 'sonar'
77
+ generate Brakeman::Report::Sonar
78
+ end
79
+
72
80
  def to_table
73
81
  require_report 'table'
74
82
  generate Brakeman::Report::Table
@@ -0,0 +1,38 @@
1
+ class Brakeman::Report::Sonar < Brakeman::Report::Base
2
+ def generate_report
3
+ report_object = {
4
+ issues: all_warnings.map { |warning| issue_json(warning) }
5
+ }
6
+ return JSON.pretty_generate report_object
7
+ end
8
+
9
+ private
10
+
11
+ def issue_json(warning)
12
+ {
13
+ engineId: "Brakeman",
14
+ ruleId: warning.warning_code,
15
+ type: "VULNERABILITY",
16
+ severity: severity_level_for(warning.confidence),
17
+ primaryLocation: {
18
+ message: warning.message,
19
+ filePath: warning.file.relative,
20
+ textRange: {
21
+ "startLine": warning.line || 1,
22
+ "endLine": warning.line || 1,
23
+ }
24
+ },
25
+ effortMinutes: (4 - warning.confidence) * 15
26
+ }
27
+ end
28
+
29
+ def severity_level_for(confidence)
30
+ if confidence == 0
31
+ "CRITICAL"
32
+ elsif confidence == 1
33
+ "MAJOR"
34
+ else
35
+ "MINOR"
36
+ end
37
+ end
38
+ end
@@ -132,10 +132,11 @@ class Brakeman::Rescanner < Brakeman::Scanner
132
132
  template_name = template_path_to_name(path)
133
133
 
134
134
  tracker.reset_template template_name
135
- fp = Brakeman::FileParser.new(tracker)
135
+ fp = Brakeman::FileParser.new(tracker.app_tree, tracker.options[:parser_timeout])
136
136
  template_parser = Brakeman::TemplateParser.new(tracker, fp)
137
137
  template_parser.parse_template path, path.read
138
- process_template fp.file_list[:templates].first
138
+ tracker.add_errors(fp.errors)
139
+ process_template fp.file_list.first
139
140
 
140
141
  @processor.process_template_alias tracker.templates[template_name]
141
142
 
@@ -390,9 +391,10 @@ class Brakeman::Rescanner < Brakeman::Scanner
390
391
 
391
392
  def parse_ruby_files list
392
393
  paths = list.select(&:exists?)
393
- file_parser = Brakeman::FileParser.new(tracker)
394
- file_parser.parse_files paths, :rescan
395
- file_parser.file_list[:rescan]
394
+ file_parser = Brakeman::FileParser.new(tracker.app_tree, tracker.options[:parser_timeout])
395
+ file_parser.parse_files paths
396
+ tracker.add_errors(file_parser.errors)
397
+ file_parser.file_list
396
398
  end
397
399
  end
398
400
 
@@ -7,6 +7,7 @@ begin
7
7
  require 'brakeman/app_tree'
8
8
  require 'brakeman/file_parser'
9
9
  require 'brakeman/parsers/template_parser'
10
+ require 'brakeman/processors/lib/file_type_detector'
10
11
  rescue LoadError => e
11
12
  $stderr.puts e.message
12
13
  $stderr.puts "Please install the appropriate dependency."
@@ -23,7 +24,10 @@ class Brakeman::Scanner
23
24
  @app_tree = Brakeman::AppTree.from_options(options)
24
25
 
25
26
  if (!@app_tree.root || !@app_tree.exists?("app")) && !options[:force_scan]
26
- raise Brakeman::NoApplication, "Please supply the path to a Rails application (looking in #{@app_tree.root})."
27
+ message = "Please supply the path to a Rails application (looking in #{@app_tree.root}).\n" <<
28
+ " Use `--force` to run a scan anyway - for example if there are many applications in one directory."
29
+
30
+ raise Brakeman::NoApplication, message
27
31
  end
28
32
 
29
33
  @processor = processor || Brakeman::Processor.new(@app_tree, options)
@@ -43,6 +47,8 @@ class Brakeman::Scanner
43
47
  process_config
44
48
  Brakeman.notify "Parsing files..."
45
49
  parse_files
50
+ Brakeman.notify "Detecting file types..."
51
+ detect_file_types
46
52
  Brakeman.notify "Processing initializers..."
47
53
  process_initializers
48
54
  Brakeman.notify "Processing libs..."
@@ -65,29 +71,47 @@ class Brakeman::Scanner
65
71
  end
66
72
 
67
73
  def parse_files
68
- fp = Brakeman::FileParser.new tracker
69
-
70
- files = {
71
- :initializers => @app_tree.initializer_paths,
72
- :controllers => @app_tree.controller_paths,
73
- :models => @app_tree.model_paths
74
- }
75
-
76
- unless options[:skip_libs]
77
- files[:libs] = @app_tree.lib_paths
78
- end
74
+ fp = Brakeman::FileParser.new(tracker.app_tree, tracker.options[:parser_timeout])
79
75
 
80
- files.each do |name, paths|
81
- fp.parse_files paths, name
82
- end
76
+ fp.parse_files tracker.app_tree.ruby_file_paths
83
77
 
84
78
  template_parser = Brakeman::TemplateParser.new(tracker, fp)
85
79
 
86
- fp.read_files(@app_tree.template_paths, :templates) do |path, contents|
80
+ fp.read_files(@app_tree.template_paths) do |path, contents|
87
81
  template_parser.parse_template path, contents
88
82
  end
89
83
 
90
- @file_list = fp.file_list
84
+ # Collect errors raised during parsing
85
+ tracker.add_errors(fp.errors)
86
+
87
+ @parsed_files = fp.file_list
88
+ end
89
+
90
+ def detect_file_types
91
+ @file_list = {
92
+ controllers: [],
93
+ initializers: [],
94
+ libs: [],
95
+ models: [],
96
+ templates: [],
97
+ }
98
+
99
+ detector = Brakeman::FileTypeDetector.new
100
+
101
+ @parsed_files.each do |file|
102
+ if file.is_a? Brakeman::TemplateParser::TemplateFile
103
+ @file_list[:templates] << file
104
+ else
105
+ type = detector.detect_type(file)
106
+ unless type == :skip
107
+ if @file_list[type].nil?
108
+ raise type.to_s
109
+ else
110
+ @file_list[type] << file
111
+ end
112
+ end
113
+ end
114
+ end
91
115
  end
92
116
 
93
117
  #Process config/environment.rb and config/gems.rb
@@ -325,7 +349,7 @@ class Brakeman::Scanner
325
349
  end
326
350
 
327
351
  def parse_ruby_file file
328
- fp = Brakeman::FileParser.new(self.tracker)
352
+ fp = Brakeman::FileParser.new(tracker.app_tree, tracker.options[:parser_timeout])
329
353
  fp.parse_ruby(file.read, file)
330
354
  end
331
355
  end
@@ -68,6 +68,12 @@ class Brakeman::Tracker
68
68
  }
69
69
  end
70
70
 
71
+ def add_errors exceptions
72
+ exceptions.each do |e|
73
+ error(e)
74
+ end
75
+ end
76
+
71
77
  #Run a set of checks on the current information. Results will be stored
72
78
  #in Tracker#checks.
73
79
  def run_checks
@@ -368,8 +368,13 @@ module Brakeman::Util
368
368
  #
369
369
  # views/test/something.html.erb -> test/something
370
370
  def template_path_to_name path
371
- names = path.relative.split("/")
371
+ names = path.relative.split('/')
372
372
  names.last.gsub!(/(\.(html|js)\..*|\.(rhtml|haml|erb|slim))$/, '')
373
- names[(names.index("views") + 1)..-1].join("/").to_sym
373
+
374
+ if names.include? 'views'
375
+ names[(names.index('views') + 1)..-1]
376
+ else
377
+ names
378
+ end.join('/').to_sym
374
379
  end
375
380
  end
@@ -1,3 +1,3 @@
1
1
  module Brakeman
2
- Version = "4.10.0"
2
+ Version = "5.0.0.pre1"
3
3
  end
@@ -119,6 +119,8 @@ module Brakeman::WarningCodes
119
119
  :CVE_2020_8159 => 115,
120
120
  :CVE_2020_8166 => 116,
121
121
  :erb_template_injection => 117,
122
+ :http_verb_confusion => 118,
123
+ :unsafe_method_reflection => 119,
122
124
 
123
125
  :custom_check => 9090,
124
126
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brakeman
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.0
4
+ version: 5.0.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-11-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Brakeman detects security vulnerabilities in Ruby on Rails applications
14
14
  via static analysis.
@@ -56,46 +56,46 @@ files:
56
56
  - bundle/ruby/2.7.0/gems/erubis-2.7.0/lib/erubis/tiny.rb
57
57
  - bundle/ruby/2.7.0/gems/erubis-2.7.0/lib/erubis/util.rb
58
58
  - bundle/ruby/2.7.0/gems/erubis-2.7.0/setup.rb
59
- - bundle/ruby/2.7.0/gems/haml-5.1.2/CHANGELOG.md
60
- - bundle/ruby/2.7.0/gems/haml-5.1.2/FAQ.md
61
- - bundle/ruby/2.7.0/gems/haml-5.1.2/Gemfile
62
- - bundle/ruby/2.7.0/gems/haml-5.1.2/MIT-LICENSE
63
- - bundle/ruby/2.7.0/gems/haml-5.1.2/README.md
64
- - bundle/ruby/2.7.0/gems/haml-5.1.2/REFERENCE.md
65
- - bundle/ruby/2.7.0/gems/haml-5.1.2/TODO
66
- - bundle/ruby/2.7.0/gems/haml-5.1.2/haml.gemspec
67
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml.rb
68
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/attribute_builder.rb
69
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/attribute_compiler.rb
70
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/attribute_parser.rb
71
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/buffer.rb
72
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/compiler.rb
73
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/engine.rb
74
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/error.rb
75
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/escapable.rb
76
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/exec.rb
77
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/filters.rb
78
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/generator.rb
79
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers.rb
80
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/action_view_extensions.rb
81
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/action_view_mods.rb
82
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/action_view_xss_mods.rb
83
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubi_template.rb
84
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
85
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/xss_mods.rb
86
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/options.rb
87
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/parser.rb
88
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/plugin.rb
89
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/railtie.rb
90
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/sass_rails_filter.rb
91
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/template.rb
92
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/template/options.rb
93
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/temple_engine.rb
94
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/temple_line_counter.rb
95
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/util.rb
96
- - bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/version.rb
97
- - bundle/ruby/2.7.0/gems/haml-5.1.2/yard/default/fulldoc/html/css/common.sass
98
- - bundle/ruby/2.7.0/gems/haml-5.1.2/yard/default/layout/html/footer.erb
59
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/CHANGELOG.md
60
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/FAQ.md
61
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/Gemfile
62
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/MIT-LICENSE
63
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/README.md
64
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/REFERENCE.md
65
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/TODO
66
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/haml.gemspec
67
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml.rb
68
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/attribute_builder.rb
69
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/attribute_compiler.rb
70
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/attribute_parser.rb
71
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/buffer.rb
72
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/compiler.rb
73
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/engine.rb
74
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/error.rb
75
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/escapable.rb
76
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/exec.rb
77
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/filters.rb
78
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/generator.rb
79
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers.rb
80
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/action_view_extensions.rb
81
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/action_view_mods.rb
82
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/action_view_xss_mods.rb
83
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/safe_erubi_template.rb
84
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/safe_erubis_template.rb
85
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/xss_mods.rb
86
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/options.rb
87
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/parser.rb
88
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/plugin.rb
89
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/railtie.rb
90
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/sass_rails_filter.rb
91
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/template.rb
92
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/template/options.rb
93
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/temple_engine.rb
94
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/temple_line_counter.rb
95
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/util.rb
96
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/version.rb
97
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/yard/default/fulldoc/html/css/common.sass
98
+ - bundle/ruby/2.7.0/gems/haml-5.2.0/yard/default/layout/html/footer.erb
99
99
  - bundle/ruby/2.7.0/gems/highline-2.0.3/AUTHORS
100
100
  - bundle/ruby/2.7.0/gems/highline-2.0.3/COPYING
101
101
  - bundle/ruby/2.7.0/gems/highline-2.0.3/Changelog.md
@@ -448,8 +448,10 @@ files:
448
448
  - lib/brakeman/checks/check_template_injection.rb
449
449
  - lib/brakeman/checks/check_translate_bug.rb
450
450
  - lib/brakeman/checks/check_unsafe_reflection.rb
451
+ - lib/brakeman/checks/check_unsafe_reflection_methods.rb
451
452
  - lib/brakeman/checks/check_unscoped_find.rb
452
453
  - lib/brakeman/checks/check_validation_regex.rb
454
+ - lib/brakeman/checks/check_verb_confusion.rb
453
455
  - lib/brakeman/checks/check_weak_hash.rb
454
456
  - lib/brakeman/checks/check_without_protection.rb
455
457
  - lib/brakeman/checks/check_xml_dos.rb
@@ -480,6 +482,7 @@ files:
480
482
  - lib/brakeman/processors/haml_template_processor.rb
481
483
  - lib/brakeman/processors/lib/basic_processor.rb
482
484
  - lib/brakeman/processors/lib/call_conversion_helper.rb
485
+ - lib/brakeman/processors/lib/file_type_detector.rb
483
486
  - lib/brakeman/processors/lib/find_all_calls.rb
484
487
  - lib/brakeman/processors/lib/find_call.rb
485
488
  - lib/brakeman/processors/lib/find_return_value.rb
@@ -516,6 +519,7 @@ files:
516
519
  - lib/brakeman/report/report_junit.rb
517
520
  - lib/brakeman/report/report_markdown.rb
518
521
  - lib/brakeman/report/report_sarif.rb
522
+ - lib/brakeman/report/report_sonar.rb
519
523
  - lib/brakeman/report/report_table.rb
520
524
  - lib/brakeman/report/report_tabs.rb
521
525
  - lib/brakeman/report/report_text.rb
@@ -565,12 +569,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
565
569
  requirements:
566
570
  - - ">="
567
571
  - !ruby/object:Gem::Version
568
- version: 2.3.0
572
+ version: 2.4.0
569
573
  required_rubygems_version: !ruby/object:Gem::Requirement
570
574
  requirements:
571
- - - ">="
575
+ - - ">"
572
576
  - !ruby/object:Gem::Version
573
- version: '0'
577
+ version: 1.3.1
574
578
  requirements: []
575
579
  rubygems_version: 3.1.2
576
580
  signing_key:
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Haml
4
- # Like Temple::Filters::Escapable, but with support for escaping by
5
- # Haml::Herlpers.html_escape and Haml::Herlpers.escape_once.
6
- class Escapable < Temple::Filter
7
- def initialize(*)
8
- super
9
- @escape_code = "::Haml::Helpers.html_escape((%s))"
10
- @escaper = eval("proc {|v| #{@escape_code % 'v'} }")
11
- @once_escape_code = "::Haml::Helpers.escape_once((%s))"
12
- @once_escaper = eval("proc {|v| #{@once_escape_code % 'v'} }")
13
- @escape = false
14
- end
15
-
16
- def on_escape(flag, exp)
17
- old = @escape
18
- @escape = flag
19
- compile(exp)
20
- ensure
21
- @escape = old
22
- end
23
-
24
- # The same as Haml::AttributeBuilder.build_attributes
25
- def on_static(value)
26
- [:static,
27
- if @escape == :once
28
- @once_escaper[value]
29
- elsif @escape
30
- @escaper[value]
31
- else
32
- value
33
- end
34
- ]
35
- end
36
-
37
- # The same as Haml::AttributeBuilder.build_attributes
38
- def on_dynamic(value)
39
- [:dynamic,
40
- if @escape == :once
41
- @once_escape_code % value
42
- elsif @escape
43
- @escape_code % value
44
- else
45
- "(#{value}).to_s"
46
- end
47
- ]
48
- end
49
- end
50
- end