Skip to content

Commit

Permalink
Clean tag attributes before passing through the escape_once logic.
Browse files Browse the repository at this point in the history
Addresses CVE-2009-3009
  • Loading branch information
NZKoz committed Sep 3, 2009
1 parent 07c6938 commit 9a68c72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/tag_helper.rb
Expand Up @@ -103,7 +103,7 @@ def cdata_section(content)
# escape_once("<< Accept & Checkout")
# # => "<< Accept & Checkout"
def escape_once(html)
html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
ActiveSupport::Multibyte.clean(html.to_s).gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
end

private
Expand Down

0 comments on commit 9a68c72

Please sign in to comment.