File tree 4 files changed +23
-1
lines changed
4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 7
7
- 2.4
8
8
- 2.5
9
9
- 2.6
10
+ - 2.7
11
+ - 3.0
10
12
- ruby-head
11
13
- jruby
12
14
matrix :
Original file line number Diff line number Diff line change
1
+ ## next / unreleased
2
+
3
+ * Processing Instructions are no longer allowed by Rails::Html::PermitScrubber
4
+
5
+ Previously, a PI with a name (or "target") matching an allowed tag name was not scrubbed. There
6
+ are no known security issues associated with these PIs, but similar to comments it's preferred to
7
+ omit these nodes when possible from sanitized output.
8
+
9
+ Fixes #115 .
10
+
11
+ * Mike Dalessio*
12
+
1
13
## 1.3.0
2
14
3
15
* Address deprecations in Loofah 2.3.0.
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def scrub(node)
68
68
end
69
69
return CONTINUE if skip_node? ( node )
70
70
71
- unless keep_node? ( node )
71
+ unless node . element? && keep_node? ( node )
72
72
return STOP if scrub_node ( node ) == STOP
73
73
end
74
74
Original file line number Diff line number Diff line change @@ -521,6 +521,14 @@ def test_uri_escaping_of_name_action_in_a_tag_in_safe_list_sanitizer
521
521
assert_equal %{<a action=\" examp<!--%22%20unsafeattr=foo()>-->le.com\" >test</a>} , text
522
522
end
523
523
524
+ def test_exclude_node_type_processing_instructions
525
+ assert_equal ( "<div>text</div><b>text</b>" , safe_list_sanitize ( "<div>text</div><?div content><b>text</b>" ) )
526
+ end
527
+
528
+ def test_exclude_node_type_comment
529
+ assert_equal ( "<div>text</div><b>text</b>" , safe_list_sanitize ( "<div>text</div><!-- comment --><b>text</b>" ) )
530
+ end
531
+
524
532
protected
525
533
526
534
def xpath_sanitize ( input , options = { } )
You can’t perform that action at this time.
0 commit comments