From eb69ad2155e37554c2411b9c11bf70dff1885085 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 26 Jul 2012 13:30:15 -0700 Subject: [PATCH] * Do not convert digest auth strings to symbols. CVE-2012-3424 --- actionpack/lib/action_controller/metal/http_authentication.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 1cfe663..67631ae 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -227,9 +227,9 @@ module ActionController end def decode_credentials(header) - Hash[header.to_s.gsub(/^Digest\s+/,'').split(',').map do |pair| + HashWithIndifferentAccess[header.to_s.gsub(/^Digest\s+/,'').split(',').map do |pair| key, value = pair.split('=', 2) - [key.strip.to_sym, value.to_s.gsub(/^"|"$/,'').gsub(/'/, '')] + [key.strip, value.to_s.gsub(/^"|"$/,'').delete('\'')] end] end -- 1.7.11.1