@@ -111,6 +111,26 @@ private predicate isSensitiveBroadcastSink(DataFlow::Node sendBroadcastCallArg)
111
111
)
112
112
}
113
113
114
+ /**
115
+ * Holds if `arg` as an argument to a use of a `startActivity` or `startService` method that sends an intent to another application.
116
+ */
117
+ private predicate isStartActivityOrServiceSink ( DataFlow:: Node arg ) {
118
+ exists ( MethodAccess ma , string name | ma .getMethod ( ) .hasName ( name ) |
119
+ arg .asExpr ( ) = ma .getArgument ( 0 ) and
120
+ ma .getMethod ( ) .getDeclaringType ( ) .getASourceSupertype * ( ) instanceof TypeContext and
121
+ // startActivity(Intent intent)
122
+ // startActivity(Intent intent, Bundle options)
123
+ // startActivities(Intent[] intents)
124
+ // startActivities(Intent[] intents, Bundle options)
125
+ // startService(Intent service)
126
+ // startForegroundService(Intent service)
127
+ // bindService (Intent service, int flags, Executor executor, ServiceConnection conn)
128
+ // bindService (Intent service, Executor executor, ServiceConnection conn)
129
+ name =
130
+ [ "startActivity" , "startActivities" , "startService" , "startForegroundService" , "bindService" ]
131
+ )
132
+ }
133
+
114
134
predicate isCleanIntent ( Expr intent ) {
115
135
intent .getType ( ) instanceof TypeIntent and
116
136
(
@@ -146,7 +166,11 @@ class SensitiveBroadcastConfig extends TaintTracking::Configuration {
146
166
source .asExpr ( ) instanceof SensitiveInfoExpr
147
167
}
148
168
149
- override predicate isSink ( DataFlow:: Node sink ) { isSensitiveBroadcastSink ( sink ) }
169
+ override predicate isSink ( DataFlow:: Node sink ) {
170
+ isSensitiveBroadcastSink ( sink )
171
+ or
172
+ isStartActivityOrServiceSink ( sink )
173
+ }
150
174
151
175
/**
152
176
* Holds if broadcast doesn't specify receiving package name of the 3rd party app
0 commit comments