Skip to content

Commit

Permalink
Ensure simple_format escapes its html attributes
Browse files Browse the repository at this point in the history
The previous behavior equated the sanitize option for simple_format with the
escape option of content_tag, however these are two distinct concepts.

This fixes CVE-2013-6416
  • Loading branch information
NZKoz authored and tenderlove committed Dec 2, 2013
1 parent 6658782 commit 4b4f584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/text_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def simple_format(text, html_options = {}, options = {})
content_tag(wrapper_tag, nil, html_options)
else
paragraphs.map { |paragraph|
content_tag(wrapper_tag, paragraph, html_options, options[:sanitize])
content_tag(wrapper_tag, raw(paragraph), html_options)
}.join("\n\n").html_safe
end
end
Expand Down

0 comments on commit 4b4f584

Please sign in to comment.