@@ -11,7 +11,7 @@ import semmle.code.java.security.AndroidIntentRedirection
11
11
class IntentRedirectionConfiguration extends TaintTracking:: Configuration {
12
12
IntentRedirectionConfiguration ( ) { this = "IntentRedirectionConfiguration" }
13
13
14
- override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
14
+ override predicate isSource ( DataFlow:: Node source ) { source instanceof IntentRedirectionSource }
15
15
16
16
override predicate isSink ( DataFlow:: Node sink ) { sink instanceof IntentRedirectionSink }
17
17
@@ -23,3 +23,35 @@ class IntentRedirectionConfiguration extends TaintTracking::Configuration {
23
23
any ( IntentRedirectionAdditionalTaintStep c ) .step ( node1 , node2 )
24
24
}
25
25
}
26
+
27
+ /** The method `getParcelableExtra` called on a tainted `Intent`. */
28
+ private class IntentRedirectionSource extends DataFlow:: Node {
29
+ IntentRedirectionSource ( ) {
30
+ exists ( GetParcelableExtra ma | this .asExpr ( ) = ma .getQualifier ( ) ) and
31
+ exists ( IntentToGetParcelableExtraConf conf | conf .hasFlowTo ( this ) )
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Data flow from a remote intent to the qualifier of a `getParcelableExtra` call.
37
+ */
38
+ private class IntentToGetParcelableExtraConf extends DataFlow2:: Configuration {
39
+ IntentToGetParcelableExtraConf ( ) { this = "IntentToGetParcelableExtraConf" }
40
+
41
+ override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
42
+
43
+ override predicate isSink ( DataFlow:: Node sink ) {
44
+ exists ( GetParcelableExtra ma | sink .asExpr ( ) = ma .getQualifier ( ) )
45
+ }
46
+ }
47
+
48
+ /** A call to the method `Intent.getParcelableExtra`. */
49
+ private class GetParcelableExtra extends MethodAccess {
50
+ GetParcelableExtra ( ) {
51
+ exists ( Method m |
52
+ this .getMethod ( ) = m and
53
+ m .getDeclaringType ( ) instanceof TypeIntent and
54
+ m .hasName ( "getParcelableExtra" )
55
+ )
56
+ }
57
+ }
0 commit comments