brakeman-min 4.8.0 → 4.8.1

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: 5df247822922b2eb40924d6fc0f4c5ce34b11a49f06a1d1dd8fce1aeea96dff7
4
- data.tar.gz: 559f77dde2d0539c0e2a3f24b10de1e1c63dee0f51ddfbeaf1b7a02bb1ac333c
3
+ metadata.gz: 92ecc405f5d8aa44662d99820f962df8e9b2fe6391837b06639511c7cb7a24bc
4
+ data.tar.gz: e991cb7e2732104d3859973aedad74ddce99157f5143c0799c90c2c489289e44
5
5
  SHA512:
6
- metadata.gz: 6b236f461c09d6a3d90f2be348e641028f44f3776fb4372a18a542c5735c5453c9e9a451c959ab31f565afb61dba96fb5837b957f16185dc84516d080a010948
7
- data.tar.gz: 58a8c876b73cf7d02b27aa4e438f0092f0ce8487d3458c311016c500ac1961a55b7b22af303c7c1db67e007a887f841661cdd2a2e005d5db7dd117938329794d
6
+ metadata.gz: 6fc22f32bfead785a7fe0b5ac06289b323b2a047528f4d1da238b8e0d233ecfabb37a869a51c72698974d9b15e7818d47ef2fafc8dd57fc578bce46c3f3a29b3
7
+ data.tar.gz: 5b96b57238d6e2813dbd83744c32ba546e116e205d0b3546bc52010621394ee7c8f012c258155aed021010e535c8f8ee706108059f7c8ef54019a66a25658d03
data/CHANGES.md CHANGED
@@ -1,4 +1,11 @@
1
- # Unreleased
1
+ # 4.8.1 - 2020-04-06
2
+
3
+ * Check SQL query strings using `String#strip` or `String.squish`
4
+ * Handle non-symbol keys in locals hash for render()
5
+ * Warn about global(!) mass assignment
6
+ * Index calls in render arguments
7
+
8
+ # 4.8.0 - 2020-02-18
2
9
 
3
10
  * Add JUnit-XML report format (Naoki Kimura)
4
11
  * Sort ignore files by fingerprint and line (Ngan Pham)
data/README.md CHANGED
@@ -74,12 +74,16 @@ To specify an output file for the results:
74
74
 
75
75
  brakeman -o output_file
76
76
 
77
- The output format is determined by the file extension or by using the `-f` option. Current options are: `text`, `html`, `tabs`, `json`, `markdown`, `csv`, and `codeclimate`.
77
+ The output format is determined by the file extension or by using the `-f` option. Current options are: `text`, `html`, `tabs`, `json`, `junit`, `markdown`, `csv`, and `codeclimate`.
78
78
 
79
79
  Multiple output files can be specified:
80
80
 
81
81
  brakeman -o output.html -o output.json
82
82
 
83
+ To output to both a file and to the console, with color:
84
+
85
+ brakeman --color -o /dev/stdout -o output.json
86
+
83
87
  To suppress informational warnings and just output the report:
84
88
 
85
89
  brakeman -q
@@ -167,6 +171,8 @@ There is a [plugin available](http://brakemanscanner.org/docs/jenkins/) for Jenk
167
171
 
168
172
  For even more continuous testing, try the [Guard plugin](https://github.com/guard/guard-brakeman).
169
173
 
174
+ There are a couple [Github Actions](https://github.com/marketplace?type=actions&query=brakeman) available.
175
+
170
176
  # Building
171
177
 
172
178
  git clone git://github.com/presidentbeef/brakeman.git
@@ -17,6 +17,7 @@ class Brakeman::CheckMassAssignment < Brakeman::BaseCheck
17
17
  def run_check
18
18
  check_mass_assignment
19
19
  check_permit!
20
+ check_permit_all_parameters
20
21
  end
21
22
 
22
23
  def find_mass_assign_calls
@@ -193,4 +194,18 @@ class Brakeman::CheckMassAssignment < Brakeman::BaseCheck
193
194
  :message => "Parameters should be whitelisted for mass assignment",
194
195
  :confidence => confidence
195
196
  end
197
+
198
+ def check_permit_all_parameters
199
+ tracker.find_call(target: :"ActionController::Parameters", method: :permit_all_parameters=).each do |result|
200
+ call = result[:call]
201
+
202
+ if true? call.first_arg
203
+ warn :result => result,
204
+ :warning_type => "Mass Assignment",
205
+ :warning_code => :mass_assign_permit_all,
206
+ :message => "Parameters should be whitelisted for mass assignment",
207
+ :confidence => :high
208
+ end
209
+ end
210
+ end
196
211
  end
@@ -393,7 +393,7 @@ class Brakeman::CheckSQL < Brakeman::BaseCheck
393
393
  nil
394
394
  end
395
395
 
396
- TO_STRING_METHODS = [:to_s, :strip_heredoc]
396
+ TO_STRING_METHODS = [:to_s, :squish, :strip, :strip_heredoc]
397
397
 
398
398
  #Returns value if interpolated value is not something safe
399
399
  def unsafe_string_interp? exp
@@ -89,7 +89,7 @@ class Brakeman::FindAllCalls < Brakeman::BasicProcessor
89
89
  #Calls to render() are converted to s(:render, ...) but we would
90
90
  #like them in the call cache still for speed
91
91
  def process_render exp
92
- process exp.last if sexp? exp.last
92
+ process_all exp
93
93
 
94
94
  add_simple_call :render, exp
95
95
 
@@ -98,7 +98,9 @@ module Brakeman::RenderHelper
98
98
 
99
99
  if hash? options[:locals]
100
100
  hash_iterate options[:locals] do |key, value|
101
- template_env[Sexp.new(:call, nil, key.value)] = value
101
+ if symbol? key
102
+ template_env[Sexp.new(:call, nil, key.value)] = value
103
+ end
102
104
  end
103
105
  end
104
106
 
@@ -1,3 +1,3 @@
1
1
  module Brakeman
2
- Version = "4.8.0"
2
+ Version = "4.8.1"
3
3
  end
@@ -113,6 +113,7 @@ module Brakeman::WarningCodes
113
113
  :force_ssl_disabled => 109,
114
114
  :unsafe_cookie_serialization => 110,
115
115
  :reverse_tabnabbing => 111,
116
+ :mass_assign_permit_all => 112,
116
117
  :custom_check => 9090,
117
118
  }
118
119
 
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: 4.8.0
4
+ version: 4.8.1
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-02-18 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
332
  requirements: []
333
- rubygems_version: 3.1.2
333
+ rubygems_version: 3.0.8
334
334
  signing_key:
335
335
  specification_version: 4
336
336
  summary: Security vulnerability scanner for Ruby on Rails.