Skip to content

Instantly share code, notes, and snippets.

@kaspth
Last active December 19, 2015 02:48
Show Gist options
  • Save kaspth/5885165 to your computer and use it in GitHub Desktop.
Save kaspth/5885165 to your computer and use it in GitHub Desktop.
The failures I'm seeing in sanitizers_test.rb.
# In actionview dir run tests with
# rake test TEST=test/template/sanitizers_test.rb
1) Failure:
SanitizerTest#test_should_not_fall_for_xss_image_hack_4 [actionview/test/template/sanitizers_test.rb:173]:
Expected: "<img>"
Actual: "<img>alert(\"XSS\")\"&gt;"
2) Failure:
SanitizerTest#test_should_sanitize_cdata_section [actionview/test/template/sanitizers_test.rb:260]:
--- expected
+++ actual
@@ -1 +1 @@
-"&lt;![CDATA[&lt;span&gt;section&lt;/span&gt;]]&gt;"
+"section]]&gt;"
3) Failure:
SanitizerTest#test_should_sanitize_script_tag_with_multiple_open_brackets [actionview/test/template/sanitizers_test.rb:186]:
Expected: "&lt;"
Actual: "alert(\"XSS\");//"
4) Failure:
SanitizerTest#test_should_sanitize_tag_broken_up_by_null [actionview/test/template/sanitizers_test.rb:178]:
Expected: "alert(\"XSS\")"
Actual: ""
5) Failure:
SanitizerTest#test_should_sanitize_unterminated_cdata_section [actionview/test/template/sanitizers_test.rb:264]:
--- expected
+++ actual
@@ -1 +1 @@
-"&lt;![CDATA[&lt;span&gt;neverending...]]&gt;"
+"neverending..."
6) Failure:
SanitizerTest#test_strip_links [actionview/test/template/sanitizers_test.rb:41]:
--- expected
+++ actual
@@ -1 +1 @@
-"all <b>day</b> long"
+"a href='hello'&gt;all <b>day</b> long/a&gt;"
# Already sent an email to tenderlove and flavorjones about this.
7) Failure:
SanitizerTest#test_strip_tags [actionview/test/template/sanitizers_test.rb:17]:
Expected: "<<<bad html"
Actual: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment