Skip to content

Commit 5b8b417

Browse files
committed
Clean tag attributes before passing through the escape_once logic.
Addresses CVE-2009-3009
1 parent e31d29f commit 5b8b417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_view/helpers/tag_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def cdata_section(content)
9999
# escape_once("<< Accept & Checkout")
100100
# # => "<< Accept & Checkout"
101101
def escape_once(html)
102-
html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
102+
ActiveSupport::Multibyte.clean(html.to_s).gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
103103
end
104104

105105
private

0 commit comments

Comments
 (0)