File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
ruby/ql/test/query-tests/experimental/cwe-176 Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change
1
+ require "erb"
2
+ include ERB ::Util
3
+ require 'cgi'
4
+
1
5
class UnicodeNormalizationOKController < ActionController ::Base
2
6
def unicodeNormalize
3
7
unicode_input = params [ :unicode_input ]
@@ -15,11 +19,20 @@ def unicodeNormalize
15
19
end
16
20
end
17
21
18
- class UnicodeNormalizationHtMLSafeController < ActionController ::Base
22
+ class UnicodeNormalizationHtMLEscapeController < ActionController ::Base
19
23
def unicodeNormalize
20
24
unicode_input = params [ :unicode_input ]
21
- unicode_html_safe = CGI . escapeHTML ( unicode_input ) . html_safe
25
+ unicode_html_safe = html_escape ( unicode_input )
22
26
normalized_nfkc = unicode_html_safe . unicode_normalize ( :nfkc ) # $result=BAD
23
27
normalized_nfc = unicode_html_safe . unicode_normalize ( :nfc ) # $result=BAD
24
28
end
25
29
end
30
+
31
+ class UnicodeNormalizationCGIHtMLEscapeController < ActionController ::Base
32
+ def unicodeNormalize
33
+ unicode_input = params [ :unicode_input ]
34
+ unicode_html_safe = CGI . escapeHTML ( unicode_input ) . html_safe
35
+ normalized_nfkc = unicode_html_safe . unicode_normalize ( :nfkd ) # $result=BAD
36
+ normalized_nfc = unicode_html_safe . unicode_normalize ( :nfd ) # $result=BAD
37
+ end
38
+ end
You can’t perform that action at this time.
0 commit comments