diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-30 15:13:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-30 15:13:42 -0700 |
commit | dff6db18840e2fd1dd3f3e4ef0ae7a9a3986d01d (patch) | |
tree | c17cc2176f64fa79dbc90ed132f846a7aa99a4eb /actionpack/test | |
parent | 71f7917c553cdc9a0ee49e87af0efb7429759718 (diff) | |
download | rails-dff6db18840e2fd1dd3f3e4ef0ae7a9a3986d01d.tar.gz rails-dff6db18840e2fd1dd3f3e4ef0ae7a9a3986d01d.tar.bz2 rails-dff6db18840e2fd1dd3f3e4ef0ae7a9a3986d01d.zip |
Strip [nil] from parameters hash.
Thanks to Ben Murphy for reporting this!
CVE-2012-2660
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/request/query_string_parsing_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/request/query_string_parsing_test.rb b/actionpack/test/dispatch/request/query_string_parsing_test.rb index f6a1475d04..181f51add5 100644 --- a/actionpack/test/dispatch/request/query_string_parsing_test.rb +++ b/actionpack/test/dispatch/request/query_string_parsing_test.rb @@ -81,7 +81,12 @@ class QueryStringParsingTest < ActionDispatch::IntegrationTest end test "query string without equal" do - assert_parses({ "action" => nil }, "action") + assert_parses({"action" => nil}, "action") + assert_parses({"action" => {"foo" => nil}}, "action[foo]") + assert_parses({"action" => {"foo" => { "bar" => nil }}}, "action[foo][bar]") + assert_parses({"action" => {"foo" => { "bar" => nil }}}, "action[foo][bar][]") + assert_parses({"action" => {"foo" => nil}}, "action[foo][]") + assert_parses({"action"=>{"foo"=>[{"bar"=>nil}]}}, "action[foo][][bar]") end test "query string with empty key" do |