Use InlineFlowTest for local and remote flow tests

This commit is contained in:
Tony Torralba
2021-10-08 11:48:35 +02:00
parent 446c738f20
commit 2df30dc107
9 changed files with 124 additions and 153 deletions

View File

@@ -4,34 +4,39 @@ import android.app.Activity;
public class IntentSources extends Activity {
private static void sink(Object o) {}
public void test() throws java.io.IOException {
String trouble = this.getIntent().getStringExtra("key");
Runtime.getRuntime().exec(trouble);
sink(trouble); // $hasRemoteTaintFlow
}
public void test2() throws java.io.IOException {
String trouble = getIntent().getStringExtra("key");
Runtime.getRuntime().exec(trouble);
sink(trouble); // $hasRemoteTaintFlow
}
public void test3() throws java.io.IOException {
String trouble = getIntent().getExtras().getString("key");
Runtime.getRuntime().exec(trouble);
sink(trouble); // $hasRemoteTaintFlow
}
}
class OtherClass {
private static void sink(Object o) {}
public void test(IntentSources is) throws java.io.IOException {
String trouble = is.getIntent().getStringExtra("key");
Runtime.getRuntime().exec(trouble);
sink(trouble); // $hasRemoteTaintFlow
}
}