@@ -10,12 +10,10 @@ private import semmle.code.java.security.ArbitraryApkInstallation
10
10
* A dataflow configuration for flow from an external source of an APK to the
11
11
* `setData[AndType][AndNormalize]` method of an intent.
12
12
*/
13
- class ApkConfiguration extends DataFlow:: Configuration {
14
- ApkConfiguration ( ) { this = "ApkConfiguration" }
13
+ private module ApkConf implements DataFlow:: ConfigSig {
14
+ predicate isSource ( DataFlow :: Node node ) { node instanceof ExternalApkSource }
15
15
16
- override predicate isSource ( DataFlow:: Node node ) { node instanceof ExternalApkSource }
17
-
18
- override predicate isSink ( DataFlow:: Node node ) {
16
+ predicate isSink ( DataFlow:: Node node ) {
19
17
exists ( MethodAccess ma |
20
18
ma .getMethod ( ) instanceof SetDataMethod and
21
19
ma .getArgument ( 0 ) = node .asExpr ( ) and
@@ -28,6 +26,23 @@ class ApkConfiguration extends DataFlow::Configuration {
28
26
}
29
27
}
30
28
29
+ module ApkConfiguration = DataFlow:: Make< ApkConf > ;
30
+
31
+ // class ApkConfiguration extends DataFlow::Configuration {
32
+ // ApkConfiguration() { this = "ApkConfiguration" }
33
+ // override predicate isSource(DataFlow::Node node) { node instanceof ExternalApkSource }
34
+ // override predicate isSink(DataFlow::Node node) {
35
+ // exists(MethodAccess ma |
36
+ // ma.getMethod() instanceof SetDataMethod and
37
+ // ma.getArgument(0) = node.asExpr() and
38
+ // (
39
+ // any(PackageArchiveMimeTypeConfiguration c).hasFlowToExpr(ma.getQualifier())
40
+ // or
41
+ // any(InstallPackageActionConfiguration c).hasFlowToExpr(ma.getQualifier())
42
+ // )
43
+ // )
44
+ // }
45
+ // }
31
46
/**
32
47
* A dataflow configuration tracking the flow from the `android.content.Intent.ACTION_INSTALL_PACKAGE`
33
48
* constant to either the constructor of an intent or the `setAction` method of an intent.
0 commit comments