Skip to content

Commit

Permalink
Add tests for html escape functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauyon Lee committed Aug 12, 2021
1 parent ed1d855 commit 814004e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions java/ql/test/library-tests/frameworks/spring/webutil/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,48 @@ public void test() throws Exception {
out = WebUtils.parseMatrixVariables(in);
sink(getMapValue(out)); // $hasTaintFlow
}
{
// "org.springframework.web.util;HtmlUtils;false;htmlEscape;;;Argument[0];ReturnValue;taint"
String out = null;
String in = (String)source();
out = HtmlUtils.htmlEscape(in, null);
sink(out); // $ hasTaintFlow
}
{
// "org.springframework.web.util;HtmlUtils;false;htmlEscape;;;Argument[0];ReturnValue;taint"
String out = null;
String in = (String)source();
out = HtmlUtils.htmlEscape(in);
sink(out); // $ hasTaintFlow
}
{
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeDecimal;;;Argument[0];ReturnValue;taint"
String out = null;
String in = (String)source();
out = HtmlUtils.htmlEscapeDecimal(in, null);
sink(out); // $ hasTaintFlow
}
{
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeDecimal;;;Argument[0];ReturnValue;taint"
String out = null;
String in = (String)source();
out = HtmlUtils.htmlEscapeDecimal(in);
sink(out); // $ hasTaintFlow
}
{
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeHex;;;Argument[0];ReturnValue;taint"
String out = null;
String in = (String)source();
out = HtmlUtils.htmlEscapeHex(in, null);
sink(out); // $ hasTaintFlow
}
{
// "org.springframework.web.util;HtmlUtils;false;htmlEscapeHex;;;Argument[0];ReturnValue;taint"
String out = null;
String in = (String)source();
out = HtmlUtils.htmlEscapeHex(in);
sink(out); // $ hasTaintFlow
}

}

Expand Down

0 comments on commit 814004e

Please sign in to comment.