diff --git a/java/ql/test/query-tests/security/CWE-094/ApkInstallationTest.ql b/java/ql/test/query-tests/security/CWE-094/ApkInstallationTest.ql new file mode 100644 index 00000000000..19a7434083a --- /dev/null +++ b/java/ql/test/query-tests/security/CWE-094/ApkInstallationTest.ql @@ -0,0 +1,19 @@ +import java +import semmle.code.java.dataflow.DataFlow +import semmle.code.java.security.ArbitraryApkInstallationQuery +import TestUtilities.InlineExpectationsTest + +class HasApkInstallationTest extends InlineExpectationsTest { + HasApkInstallationTest() { this = "HasApkInstallationTest" } + + override string getARelevantTag() { result = "hasApkInstallation" } + + override predicate hasActualResult(Location location, string element, string tag, string value) { + tag = "hasApkInstallation" and + exists(DataFlow::Node sink, ApkConfiguration conf | conf.hasFlowTo(sink) | + sink.getLocation() = location and + element = sink.toString() and + value = "" + ) + } +}