actionpack 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionpack might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fbfd3478ffdabae6c448f11b8d2555183dc9afa
4
- data.tar.gz: c943680b657f1ee41a97fc0b3e45ed917f651ff6
3
+ metadata.gz: 88bdd4990a97dcad1337f5538672cf2ba466bc9e
4
+ data.tar.gz: 5c5e247912af700ec1d6cfe4a46d6fd123d6d2c9
5
5
  SHA512:
6
- metadata.gz: de8fa29de785a8374d2f42a857d0cfaa6767dd509d2b8550367a57af9adcc07d0aa0a3fe5853e3983481d2c77d4879eb016dce956d0d7a8fbbcae66eba1adf93
7
- data.tar.gz: fc2e767c978ef701d1b7cac55cd691ee3aa202c0afe2ebb28710dbc5f6bdccbcc5679c18a2e7d670f50df90f5429d741e759b21e81b08d9ee12b17c431cc30c2
6
+ metadata.gz: 24449d94d5ae99d1571a69d0c39459c07c88effd7614c1f368bb359688aec13f492e0b42fe4d8cf924d6879d5a309261567e6f2019d5b34a60fbcf2637877b50
7
+ data.tar.gz: e81f58104713eb4cecddc46b0903bbf436a19e7bd40c347311ba1fdce6f7a4f30d6cb62ddc92cbb9b9e8550693c172c29846f1fa5ee9ed5dc5aafd741ad2af59
@@ -1,3 +1,9 @@
1
+ * Escape format, negative_format and units options of number helpers
2
+
3
+ Fixes: CVE-2014-0081
4
+
5
+ ## Rails 4.0.2 (December 02, 2013) ##
6
+
1
7
  * Ensure simple_format escapes its html attributes. This fixes CVE-2013-6416
2
8
 
3
9
  * Deep Munge the parameters for GET and POST Fixes CVE-2013-6417
@@ -1,7 +1,7 @@
1
1
  module ActionPack
2
2
  # Returns the version of the currently loaded ActionPack as a Gem::Version
3
3
  def self.version
4
- Gem::Version.new "4.0.2"
4
+ Gem::Version.new "4.0.3"
5
5
  end
6
6
 
7
7
  module VERSION #:nodoc:
@@ -106,7 +106,7 @@ module ActionView
106
106
  # # => 1234567890,50 £
107
107
  def number_to_currency(number, options = {})
108
108
  return unless number
109
- options = escape_unsafe_delimiters_and_separators(options.symbolize_keys)
109
+ options = escape_unsafe_options(options.symbolize_keys)
110
110
 
111
111
  wrap_with_output_safety_handling(number, options.delete(:raise)) {
112
112
  ActiveSupport::NumberHelper.number_to_currency(number, options)
@@ -151,7 +151,7 @@ module ActionView
151
151
  # number_to_percentage("98a", raise: true) # => InvalidNumberError
152
152
  def number_to_percentage(number, options = {})
153
153
  return unless number
154
- options = escape_unsafe_delimiters_and_separators(options.symbolize_keys)
154
+ options = escape_unsafe_options(options.symbolize_keys)
155
155
 
156
156
  wrap_with_output_safety_handling(number, options.delete(:raise)) {
157
157
  ActiveSupport::NumberHelper.number_to_percentage(number, options)
@@ -188,7 +188,7 @@ module ActionView
188
188
  #
189
189
  # number_with_delimiter("112a", raise: true) # => raise InvalidNumberError
190
190
  def number_with_delimiter(number, options = {})
191
- options = escape_unsafe_delimiters_and_separators(options.symbolize_keys)
191
+ options = escape_unsafe_options(options.symbolize_keys)
192
192
 
193
193
  wrap_with_output_safety_handling(number, options.delete(:raise)) {
194
194
  ActiveSupport::NumberHelper.number_to_delimited(number, options)
@@ -237,7 +237,7 @@ module ActionView
237
237
  # number_with_precision(1111.2345, precision: 2, separator: ',', delimiter: '.')
238
238
  # # => 1.111,23
239
239
  def number_with_precision(number, options = {})
240
- options = escape_unsafe_delimiters_and_separators(options.symbolize_keys)
240
+ options = escape_unsafe_options(options.symbolize_keys)
241
241
 
242
242
  wrap_with_output_safety_handling(number, options.delete(:raise)) {
243
243
  ActiveSupport::NumberHelper.number_to_rounded(number, options)
@@ -293,7 +293,7 @@ module ActionView
293
293
  # number_to_human_size(1234567890123, precision: 5) # => "1.1229 TB"
294
294
  # number_to_human_size(524288000, precision: 5) # => "500 MB"
295
295
  def number_to_human_size(number, options = {})
296
- options = escape_unsafe_delimiters_and_separators(options.symbolize_keys)
296
+ options = escape_unsafe_options(options.symbolize_keys)
297
297
 
298
298
  wrap_with_output_safety_handling(number, options.delete(:raise)) {
299
299
  ActiveSupport::NumberHelper.number_to_human_size(number, options)
@@ -399,7 +399,7 @@ module ActionView
399
399
  # number_to_human(0.34, units: :distance) # => "34 centimeters"
400
400
  #
401
401
  def number_to_human(number, options = {})
402
- options = escape_unsafe_delimiters_and_separators(options.symbolize_keys)
402
+ options = escape_unsafe_options(options.symbolize_keys)
403
403
 
404
404
  wrap_with_output_safety_handling(number, options.delete(:raise)) {
405
405
  ActiveSupport::NumberHelper.number_to_human(number, options)
@@ -408,13 +408,22 @@ module ActionView
408
408
 
409
409
  private
410
410
 
411
- def escape_unsafe_delimiters_and_separators(options)
412
- options[:separator] = ERB::Util.html_escape(options[:separator]) if options[:separator] && !options[:separator].html_safe?
413
- options[:delimiter] = ERB::Util.html_escape(options[:delimiter]) if options[:delimiter] && !options[:delimiter].html_safe?
414
- options[:unit] = ERB::Util.html_escape(options[:unit]) if options[:unit] && !options[:unit].html_safe?
411
+ def escape_unsafe_options(options)
412
+ options[:format] = ERB::Util.html_escape(options[:format]) if options[:format]
413
+ options[:negative_format] = ERB::Util.html_escape(options[:negative_format]) if options[:negative_format]
414
+ options[:separator] = ERB::Util.html_escape(options[:separator]) if options[:separator]
415
+ options[:delimiter] = ERB::Util.html_escape(options[:delimiter]) if options[:delimiter]
416
+ options[:unit] = ERB::Util.html_escape(options[:unit]) if options[:unit] && !options[:unit].html_safe?
417
+ options[:units] = escape_units(options[:units]) if options[:units] && Hash === options[:units]
415
418
  options
416
419
  end
417
420
 
421
+ def escape_units(units)
422
+ Hash[units.map do |k, v|
423
+ [k, ERB::Util.html_escape(v)]
424
+ end]
425
+ end
426
+
418
427
  def wrap_with_output_safety_handling(number, raise_on_invalid, &block)
419
428
  valid_float = valid_float?(number)
420
429
  raise InvalidNumberError, number if raise_on_invalid && !valid_float
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.2
19
+ version: 4.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.2
26
+ version: 4.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 4.0.2
89
+ version: 4.0.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 4.0.2
96
+ version: 4.0.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: tzinfo
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -116,8 +116,9 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - CHANGELOG.md
119
- - README.rdoc
120
119
  - MIT-LICENSE
120
+ - README.rdoc
121
+ - lib/abstract_controller.rb
121
122
  - lib/abstract_controller/asset_paths.rb
122
123
  - lib/abstract_controller/base.rb
123
124
  - lib/abstract_controller/callbacks.rb
@@ -130,13 +131,14 @@ files:
130
131
  - lib/abstract_controller/translation.rb
131
132
  - lib/abstract_controller/url_for.rb
132
133
  - lib/abstract_controller/view_paths.rb
133
- - lib/abstract_controller.rb
134
+ - lib/action_controller.rb
134
135
  - lib/action_controller/base.rb
135
- - lib/action_controller/caching/fragments.rb
136
136
  - lib/action_controller/caching.rb
137
- - lib/action_controller/deprecated/integration_test.rb
137
+ - lib/action_controller/caching/fragments.rb
138
138
  - lib/action_controller/deprecated.rb
139
+ - lib/action_controller/deprecated/integration_test.rb
139
140
  - lib/action_controller/log_subscriber.rb
141
+ - lib/action_controller/metal.rb
140
142
  - lib/action_controller/metal/conditional_get.rb
141
143
  - lib/action_controller/metal/cookies.rb
142
144
  - lib/action_controller/metal/data_streaming.rb
@@ -163,7 +165,6 @@ files:
163
165
  - lib/action_controller/metal/strong_parameters.rb
164
166
  - lib/action_controller/metal/testing.rb
165
167
  - lib/action_controller/metal/url_for.rb
166
- - lib/action_controller/metal.rb
167
168
  - lib/action_controller/middleware.rb
168
169
  - lib/action_controller/model_naming.rb
169
170
  - lib/action_controller/railtie.rb
@@ -171,7 +172,7 @@ files:
171
172
  - lib/action_controller/record_identifier.rb
172
173
  - lib/action_controller/test_case.rb
173
174
  - lib/action_controller/vendor/html-scanner.rb
174
- - lib/action_controller.rb
175
+ - lib/action_dispatch.rb
175
176
  - lib/action_dispatch/http/cache.rb
176
177
  - lib/action_dispatch/http/filter_parameters.rb
177
178
  - lib/action_dispatch/http/filter_redirect.rb
@@ -186,6 +187,7 @@ files:
186
187
  - lib/action_dispatch/http/response.rb
187
188
  - lib/action_dispatch/http/upload.rb
188
189
  - lib/action_dispatch/http/url.rb
190
+ - lib/action_dispatch/journey.rb
189
191
  - lib/action_dispatch/journey/backwards.rb
190
192
  - lib/action_dispatch/journey/formatter.rb
191
193
  - lib/action_dispatch/journey/gtg/builder.rb
@@ -201,16 +203,15 @@ files:
201
203
  - lib/action_dispatch/journey/parser_extras.rb
202
204
  - lib/action_dispatch/journey/path/pattern.rb
203
205
  - lib/action_dispatch/journey/route.rb
206
+ - lib/action_dispatch/journey/router.rb
204
207
  - lib/action_dispatch/journey/router/strexp.rb
205
208
  - lib/action_dispatch/journey/router/utils.rb
206
- - lib/action_dispatch/journey/router.rb
207
209
  - lib/action_dispatch/journey/routes.rb
208
210
  - lib/action_dispatch/journey/scanner.rb
209
211
  - lib/action_dispatch/journey/visitors.rb
210
212
  - lib/action_dispatch/journey/visualizer/fsm.css
211
213
  - lib/action_dispatch/journey/visualizer/fsm.js
212
214
  - lib/action_dispatch/journey/visualizer/index.html.erb
213
- - lib/action_dispatch/journey.rb
214
215
  - lib/action_dispatch/middleware/callbacks.rb
215
216
  - lib/action_dispatch/middleware/cookies.rb
216
217
  - lib/action_dispatch/middleware/debug_exceptions.rb
@@ -242,6 +243,7 @@ files:
242
243
  - lib/action_dispatch/middleware/templates/routes/_table.html.erb
243
244
  - lib/action_dispatch/railtie.rb
244
245
  - lib/action_dispatch/request/session.rb
246
+ - lib/action_dispatch/routing.rb
245
247
  - lib/action_dispatch/routing/inspector.rb
246
248
  - lib/action_dispatch/routing/mapper.rb
247
249
  - lib/action_dispatch/routing/polymorphic_routes.rb
@@ -249,26 +251,26 @@ files:
249
251
  - lib/action_dispatch/routing/route_set.rb
250
252
  - lib/action_dispatch/routing/routes_proxy.rb
251
253
  - lib/action_dispatch/routing/url_for.rb
252
- - lib/action_dispatch/routing.rb
254
+ - lib/action_dispatch/testing/assertions.rb
253
255
  - lib/action_dispatch/testing/assertions/dom.rb
254
256
  - lib/action_dispatch/testing/assertions/response.rb
255
257
  - lib/action_dispatch/testing/assertions/routing.rb
256
258
  - lib/action_dispatch/testing/assertions/selector.rb
257
259
  - lib/action_dispatch/testing/assertions/tag.rb
258
- - lib/action_dispatch/testing/assertions.rb
259
260
  - lib/action_dispatch/testing/integration.rb
260
261
  - lib/action_dispatch/testing/test_process.rb
261
262
  - lib/action_dispatch/testing/test_request.rb
262
263
  - lib/action_dispatch/testing/test_response.rb
263
- - lib/action_dispatch.rb
264
- - lib/action_pack/version.rb
265
264
  - lib/action_pack.rb
265
+ - lib/action_pack/version.rb
266
+ - lib/action_view.rb
266
267
  - lib/action_view/base.rb
267
268
  - lib/action_view/buffers.rb
268
269
  - lib/action_view/context.rb
269
270
  - lib/action_view/dependency_tracker.rb
270
271
  - lib/action_view/digestor.rb
271
272
  - lib/action_view/flows.rb
273
+ - lib/action_view/helpers.rb
272
274
  - lib/action_view/helpers/active_model_helper.rb
273
275
  - lib/action_view/helpers/asset_tag_helper.rb
274
276
  - lib/action_view/helpers/asset_url_helper.rb
@@ -289,6 +291,7 @@ files:
289
291
  - lib/action_view/helpers/rendering_helper.rb
290
292
  - lib/action_view/helpers/sanitize_helper.rb
291
293
  - lib/action_view/helpers/tag_helper.rb
294
+ - lib/action_view/helpers/tags.rb
292
295
  - lib/action_view/helpers/tags/base.rb
293
296
  - lib/action_view/helpers/tags/check_box.rb
294
297
  - lib/action_view/helpers/tags/checkable.rb
@@ -322,11 +325,9 @@ files:
322
325
  - lib/action_view/helpers/tags/time_zone_select.rb
323
326
  - lib/action_view/helpers/tags/url_field.rb
324
327
  - lib/action_view/helpers/tags/week_field.rb
325
- - lib/action_view/helpers/tags.rb
326
328
  - lib/action_view/helpers/text_helper.rb
327
329
  - lib/action_view/helpers/translation_helper.rb
328
330
  - lib/action_view/helpers/url_helper.rb
329
- - lib/action_view/helpers.rb
330
331
  - lib/action_view/locale/en.yml
331
332
  - lib/action_view/log_subscriber.rb
332
333
  - lib/action_view/lookup_context.rb
@@ -341,25 +342,24 @@ files:
341
342
  - lib/action_view/renderer/template_renderer.rb
342
343
  - lib/action_view/routing_url_for.rb
343
344
  - lib/action_view/tasks/dependencies.rake
345
+ - lib/action_view/template.rb
344
346
  - lib/action_view/template/error.rb
347
+ - lib/action_view/template/handlers.rb
345
348
  - lib/action_view/template/handlers/builder.rb
346
349
  - lib/action_view/template/handlers/erb.rb
347
350
  - lib/action_view/template/handlers/raw.rb
348
- - lib/action_view/template/handlers.rb
349
351
  - lib/action_view/template/resolver.rb
350
352
  - lib/action_view/template/text.rb
351
353
  - lib/action_view/template/types.rb
352
- - lib/action_view/template.rb
353
354
  - lib/action_view/test_case.rb
354
355
  - lib/action_view/testing/resolvers.rb
356
+ - lib/action_view/vendor/html-scanner.rb
355
357
  - lib/action_view/vendor/html-scanner/html/document.rb
356
358
  - lib/action_view/vendor/html-scanner/html/node.rb
357
359
  - lib/action_view/vendor/html-scanner/html/sanitizer.rb
358
360
  - lib/action_view/vendor/html-scanner/html/selector.rb
359
361
  - lib/action_view/vendor/html-scanner/html/tokenizer.rb
360
362
  - lib/action_view/vendor/html-scanner/html/version.rb
361
- - lib/action_view/vendor/html-scanner.rb
362
- - lib/action_view.rb
363
363
  homepage: http://www.rubyonrails.org
364
364
  licenses:
365
365
  - MIT
@@ -381,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
381
  requirements:
382
382
  - none
383
383
  rubyforge_project:
384
- rubygems_version: 2.0.2
384
+ rubygems_version: 2.2.0
385
385
  signing_key:
386
386
  specification_version: 4
387
387
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).