Skip to content

Commit 814004e

Browse files
author
Sauyon Lee
committed
Add tests for html escape functions
1 parent ed1d855 commit 814004e

File tree

1 file changed

+42
-0
lines changed
  • java/ql/test/library-tests/frameworks/spring/webutil

1 file changed

+42
-0
lines changed

java/ql/test/library-tests/frameworks/spring/webutil/Test.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,6 +2579,48 @@ public void test() throws Exception {
25792579
out = WebUtils.parseMatrixVariables(in);
25802580
sink(getMapValue(out)); // $hasTaintFlow
25812581
}
2582+
{
2583+
// "org.springframework.web.util;HtmlUtils;false;htmlEscape;;;Argument[0];ReturnValue;taint"
2584+
String out = null;
2585+
String in = (String)source();
2586+
out = HtmlUtils.htmlEscape(in, null);
2587+
sink(out); // $ hasTaintFlow
2588+
}
2589+
{
2590+
// "org.springframework.web.util;HtmlUtils;false;htmlEscape;;;Argument[0];ReturnValue;taint"
2591+
String out = null;
2592+
String in = (String)source();
2593+
out = HtmlUtils.htmlEscape(in);
2594+
sink(out); // $ hasTaintFlow
2595+
}
2596+
{
2597+
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeDecimal;;;Argument[0];ReturnValue;taint"
2598+
String out = null;
2599+
String in = (String)source();
2600+
out = HtmlUtils.htmlEscapeDecimal(in, null);
2601+
sink(out); // $ hasTaintFlow
2602+
}
2603+
{
2604+
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeDecimal;;;Argument[0];ReturnValue;taint"
2605+
String out = null;
2606+
String in = (String)source();
2607+
out = HtmlUtils.htmlEscapeDecimal(in);
2608+
sink(out); // $ hasTaintFlow
2609+
}
2610+
{
2611+
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeHex;;;Argument[0];ReturnValue;taint"
2612+
String out = null;
2613+
String in = (String)source();
2614+
out = HtmlUtils.htmlEscapeHex(in, null);
2615+
sink(out); // $ hasTaintFlow
2616+
}
2617+
{
2618+
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeHex;;;Argument[0];ReturnValue;taint"
2619+
String out = null;
2620+
String in = (String)source();
2621+
out = HtmlUtils.htmlEscapeHex(in);
2622+
sink(out); // $ hasTaintFlow
2623+
}
25822624

25832625
}
25842626

0 commit comments

Comments
 (0)