brakeman-min 5.4.1 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a188afc9f3a8b700140582ea3bf9632ef909fde940fb24dd62a71e5d217944c1
4
- data.tar.gz: 92d9d4e2a79ad4119866dd24238521052bfb2bd10d2511ac9dbeeec1a3576f4e
3
+ metadata.gz: 84b6e99be6a1ace4751801f306ab240f4ae95b816f334638c31d8723141626f9
4
+ data.tar.gz: 89d6d23b4a36f1f9613a8d7053baf686d4e270dff05f0ae9ea416eed96f89374
5
5
  SHA512:
6
- metadata.gz: 9cf69d5ddc77ffc77096e46a57511847304821e5f655e9c19cc371e7aeeb96f766c2e5956618f942d27dfce68ef31142f3d74b1ef5e0bcb979bcd63929f68030
7
- data.tar.gz: c3e1fbf2240fc9bc2a1cb58d724321d36c443bd84dedae296746e1a3e26345ca033d7be199ce7fda0f375e8144cb2b7ecef2a1179e4733f995e714d6c43c029c
6
+ metadata.gz: 2f35f6f6f70184b74cfa6660e82545f0e2328067575e114e8a5e425168bf58b6f7c3adb9f39bc02cb7cc902816c2fa15d115095c04201e6e32427128c7e767b8
7
+ data.tar.gz: 480cde72b7d0bd9fb253a5b0af4a22ddfd56fd1967dbede8daa6c357415fac4e5bddfacd2a2f5d53c0663713ff1ccc5ed0568b5522d9240c31ef140a371ea27c
data/CHANGES.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 6.0.0 - 2023-05-24
2
+
3
+ * Add obsolete fingerprints to comparison report
4
+ * Warn about missing CSRF protection when defaults are not loaded (Chris Kruger)
5
+ * Scan directories that include the word `public`
6
+ * Raise minimum Ruby version to 3.0
7
+ * Drop support for Ruby 1.8/1.9 syntax
8
+ * Fix end-of-life dates for Ruby
9
+ * Fix false positive with `content_tag` in newer Rails
10
+
1
11
  # 5.4.1 - 2023-02-21
2
12
 
3
13
  * Fix file/line location for EOL software warnings
data/README.md CHANGED
@@ -66,7 +66,7 @@ Outside of Rails root (note that the output file is relative to path/to/rails/ap
66
66
 
67
67
  Brakeman should work with any version of Rails from 2.3.x to 7.x.
68
68
 
69
- Brakeman can analyze code written with Ruby 1.8 syntax and newer, but requires at least Ruby 2.5.0 to run.
69
+ Brakeman can analyze code written with Ruby 2.0 syntax and newer, but requires at least Ruby 3.0.0 to run.
70
70
 
71
71
  # Basic Options
72
72
 
@@ -182,7 +182,7 @@ There is a [plugin available](http://brakemanscanner.org/docs/jenkins/) for Jenk
182
182
 
183
183
  For even more continuous testing, try the [Guard plugin](https://github.com/guard/guard-brakeman).
184
184
 
185
- There are a couple [Github Actions](https://github.com/marketplace?type=actions&query=brakeman) available.
185
+ There are a couple [GitHub Actions](https://github.com/marketplace?type=actions&query=brakeman) available.
186
186
 
187
187
  # Building
188
188
 
@@ -197,7 +197,6 @@ module Brakeman
197
197
  spec/
198
198
  test/
199
199
  tmp/
200
- public/
201
200
  log/
202
201
  ]
203
202
 
@@ -73,11 +73,14 @@ class Brakeman::CheckContentTag < Brakeman::CheckCrossSiteScripting
73
73
  check_argument result, content
74
74
  end
75
75
 
76
- #Attribute keys are never escaped, so check them for user input
77
- if not @matched and hash? attributes and not request_value? attributes
78
- hash_iterate(attributes) do |k, _v|
79
- check_argument result, k
80
- return if @matched
76
+ # This changed in Rails 6.1.6
77
+ if version_between? '0.0.0', '6.1.5'
78
+ #Attribute keys are never escaped, so check them for user input
79
+ if not @matched and hash? attributes and not request_value? attributes
80
+ hash_iterate(attributes) do |k, _v|
81
+ check_argument result, k
82
+ return if @matched
83
+ end
81
84
  end
82
85
  end
83
86
 
@@ -21,6 +21,8 @@ class Brakeman::CheckEOLRuby < Brakeman::EOLCheck
21
21
  ['2.5.0', '2.5.99'] => Date.new(2021, 3, 31),
22
22
  ['2.6.0', '2.6.99'] => Date.new(2022, 3, 31),
23
23
  ['2.7.0', '2.7.99'] => Date.new(2023, 3, 31),
24
- ['3.0.0', '2.8.99'] => Date.new(2024, 3, 31),
24
+ ['3.0.0', '3.0.99'] => Date.new(2024, 3, 31),
25
+ ['3.1.0', '3.1.99'] => Date.new(2025, 3, 31),
26
+ ['3.2.0', '3.2.99'] => Date.new(2026, 3, 31),
25
27
  }
26
28
  end
@@ -1,4 +1,4 @@
1
- # Github Actions Formatter
1
+ # GitHub Actions Formatter
2
2
  # Formats warnings as workflow commands to create annotations in GitHub UI
3
3
  class Brakeman::Report::Github < Brakeman::Report::Base
4
4
  def generate_report
@@ -1,6 +1,5 @@
1
1
  begin
2
2
  Brakeman.load_brakeman_dependency 'ruby_parser'
3
- Brakeman.load_brakeman_dependency 'ruby_parser/legacy'
4
3
  require 'ruby_parser/bm_sexp.rb'
5
4
  require 'ruby_parser/bm_sexp_processor.rb'
6
5
  require 'brakeman/processor'
@@ -20,9 +20,7 @@ module Brakeman
20
20
 
21
21
  def default_protect_from_forgery?
22
22
  if version_between? "5.2.0.beta1", "9.9.9"
23
- if @rails.dig(:action_controller, :default_protect_from_forgery) == Sexp.new(:false)
24
- return false
25
- else
23
+ if @rails.dig(:action_controller, :default_protect_from_forgery) == Sexp.new(:true)
26
24
  return true
27
25
  end
28
26
  end
@@ -1,3 +1,3 @@
1
1
  module Brakeman
2
- Version = "5.4.1"
2
+ Version = "6.0.0"
3
3
  end
data/lib/brakeman.rb CHANGED
@@ -493,10 +493,14 @@ module Brakeman
493
493
  end
494
494
 
495
495
  tracker = run(options)
496
+ new_report = JSON.parse(tracker.report.to_json, symbolize_names: true)
496
497
 
497
- new_results = JSON.parse(tracker.report.to_json, :symbolize_names => true)[:warnings]
498
+ new_results = new_report[:warnings]
499
+ obsolete_ignored = tracker.unused_fingerprints
498
500
 
499
- Brakeman::Differ.new(new_results, previous_results).diff
501
+ Brakeman::Differ.new(new_results, previous_results).diff.tap do |diff|
502
+ diff[:obsolete] = obsolete_ignored
503
+ end
500
504
  end
501
505
 
502
506
  def self.load_brakeman_dependency name, allow_fail = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brakeman-min
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-21 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.19'
97
- - !ruby/object:Gem::Dependency
98
- name: ruby_parser-legacy
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '1.0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '1.0'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: sexp_processor
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -375,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
361
  - !ruby/object:Gem::Version
376
362
  version: '0'
377
363
  requirements: []
378
- rubygems_version: 3.3.3
364
+ rubygems_version: 3.2.3
379
365
  signing_key:
380
366
  specification_version: 4
381
367
  summary: Security vulnerability scanner for Ruby on Rails.