diff options
author | Michael Koziarski <michael@koziarski.com> | 2013-11-30 16:45:23 +1300 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-12-02 16:44:27 -0800 |
commit | 4e9dd5378bd5bfaa095a96068c7d1b7c4f47e1b0 (patch) | |
tree | ba544df1b4a7b4794a833bf52a3e081884045edf /actionpack/lib/action_dispatch | |
parent | 0c7ac34aed1845044cd1911e5a775366d7ca41c1 (diff) | |
download | rails-4e9dd5378bd5bfaa095a96068c7d1b7c4f47e1b0.tar.gz rails-4e9dd5378bd5bfaa095a96068c7d1b7c4f47e1b0.tar.bz2 rails-4e9dd5378bd5bfaa095a96068c7d1b7c4f47e1b0.zip |
Deep Munge the parameters for GET and POST
The previous implementation of this functionality could be accidentally
subverted by instantiating a raw Rack::Request before the first Rails::Request
was constructed.
Fixes CVE-2013-6417
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 99b81c898f..071ff0b63e 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -271,7 +271,7 @@ module ActionDispatch # Override Rack's GET method to support indifferent access def GET - @env["action_dispatch.request.query_parameters"] ||= (normalize_encode_params(super) || {}) + @env["action_dispatch.request.query_parameters"] ||= deep_munge((normalize_encode_params(super) || {})) rescue TypeError => e raise ActionController::BadRequest.new(:query, e) end @@ -279,7 +279,7 @@ module ActionDispatch # Override Rack's POST method to support indifferent access def POST - @env["action_dispatch.request.request_parameters"] ||= (normalize_encode_params(super) || {}) + @env["action_dispatch.request.request_parameters"] ||= deep_munge((normalize_encode_params(super) || {})) rescue TypeError => e raise ActionController::BadRequest.new(:request, e) end |