aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-08-08 14:33:39 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-08-09 16:06:17 -0300
commite91e4e8bbee12ce1496bf384c04da6be296b687a (patch)
tree1ee0549ee6fe5d3c745d793bd9fc2407974e4975 /actionpack/test/template
parent6d0526db91afb0675c2ad3d871529d1536303c64 (diff)
downloadrails-e91e4e8bbee12ce1496bf384c04da6be296b687a.tar.gz
rails-e91e4e8bbee12ce1496bf384c04da6be296b687a.tar.bz2
rails-e91e4e8bbee12ce1496bf384c04da6be296b687a.zip
Do not mark strip_tags result as html_safe
Thanks to Marek Labos & Nethemba CVE-2012-3465
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/sanitize_helper_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/template/sanitize_helper_test.rb b/actionpack/test/template/sanitize_helper_test.rb
index 222d4dbf4c..cc93b53ea6 100644
--- a/actionpack/test/template/sanitize_helper_test.rb
+++ b/actionpack/test/template/sanitize_helper_test.rb
@@ -42,9 +42,9 @@ class SanitizeHelperTest < ActionView::TestCase
[nil, '', ' '].each do |blank|
stripped = strip_tags(blank)
assert_equal blank, stripped
- assert stripped.html_safe? unless blank.nil?
end
- assert strip_tags("<script>").html_safe?
+ assert_equal "", strip_tags("<script>")
+ assert_equal "something &lt;img onerror=alert(1337)", ERB::Util.html_escape(strip_tags("something <img onerror=alert(1337)"))
end
def test_sanitize_is_marked_safe