mirror of
https://github.com/github/rails.git
synced 2026-01-08 22:27:59 -05:00
Only use valid mime type symbols as cache keys
CVE-2013-6414
This commit is contained in:
@@ -62,6 +62,13 @@ module ActionView
|
||||
@details_keys = Hash.new
|
||||
|
||||
def self.get(details)
|
||||
if details[:formats]
|
||||
details = details.dup
|
||||
syms = Set.new Mime::SET.symbols
|
||||
details[:formats] = details[:formats].select { |v|
|
||||
syms.include? v
|
||||
}
|
||||
end
|
||||
@details_keys[details] ||= new
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user