Skip to content
Snippets Groups Projects
Commit 147a1035 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Monkey patch for CVE-2013-6414

parent 2d65430c
No related branches found
No related tags found
No related merge requests found
# Monkey patch for Ruby on Rails vulnerability CVE-2013-6414
# https://groups.google.com/d/msg/ruby-security-ann/A-ebV4WxzKg/KNPTbX8XAQUJ
ActiveSupport.on_load(:action_view) do
ActionView::LookupContext::DetailsKey.class_eval do
class << self
alias :old_get :get
def get(details)
if details[:formats]
details = details.dup
syms = Set.new Mime::SET.symbols
details[:formats] = details[:formats].select { |v|
syms.include? v
}
end
old_get details
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment