Skip to content

Commit 39b6678

Browse files
author
Sebastian Bauersfeld
committed
Java: Add test case for StringEscapeUtils.escapeJson() taint step.
1 parent e2a9ced commit 39b6678

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import org.apache.commons.lang3.StringEscapeUtils;
2+
3+
public class StringEscapeUtilsTest {
4+
String taint() { return "tainted"; }
5+
6+
void sink(Object o) {}
7+
8+
void test() throws Exception {
9+
sink(StringEscapeUtils.escapeJson(taint())); // $hasTaintFlow
10+
}
11+
}

java/ql/test/stubs/apache-commons-lang3-3.7/org/apache/commons/lang3/StringEscapeUtils.java

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/ql/test/stubs/apache-commons-lang3-3.7/org/apache/commons/lang3/text/translate/CharSequenceTranslator.java

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)