@@ -305,48 +305,22 @@ class ReverseDNSMethod extends Method {
305305 }
306306}
307307
308- /** Android `Intent` that may have come from a hostile application. */
309- class AndroidIntentInput extends DataFlow :: Node {
308+ /** Exported Android `Intent` that may have come from a hostile application. */
309+ class AndroidIntentInput extends RemoteFlowSource {
310310 AndroidIntentInput ( ) {
311- exists ( MethodAccess ma , AndroidGetIntentMethod m |
312- ma .getMethod ( ) .overrides * ( m ) and
313- this .asExpr ( ) = ma
314- )
315- or
316- exists ( Method m , AndroidReceiveIntentMethod rI |
317- m .overrides * ( rI ) and
318- this .asParameter ( ) = m .getParameter ( 1 )
319- )
320- }
321- }
322-
323- /** Method access to external inputs of `android.content.Intent` or `android.os.BaseBundle` object. */
324- class IntentGetExtraMethodAccess extends MethodAccess {
325- IntentGetExtraMethodAccess ( ) {
326- exists ( AndroidComponent ac |
327- this .getEnclosingCallable ( ) .getDeclaringType ( ) = ac and
328- ac .isExported ( ) and
329- this .getMethod ( ) .getName ( ) .regexpMatch ( "get\\w+Extra" ) and
330- this .getMethod ( ) .getDeclaringType ( ) instanceof TypeIntent
331- )
332- or
333- this .getMethod ( ) .getName ( ) .regexpMatch ( "get\\w+" ) and
334- this
335- .getMethod ( )
336- .getDeclaringType ( )
337- .getASupertype * ( )
338- .hasQualifiedName ( "android.os" , "BaseBundle" )
339- }
340- }
341-
342- /** Android intent extra source. */
343- private class AndroidIntentExtraSource extends RemoteFlowSource {
344- AndroidIntentExtraSource ( ) {
345- exists ( AndroidIntentInput inode |
346- this .asExpr ( ) = inode .asExpr ( ) or
347- this .asExpr ( ) = inode .asParameter ( ) .getAnAccess ( )
311+ this .getEnclosingCallable ( ) .getDeclaringType ( ) .( AndroidComponent ) .isExported ( ) and
312+ (
313+ exists ( MethodAccess ma , AndroidGetIntentMethod m |
314+ ma .getMethod ( ) .overrides * ( m ) and
315+ this .asExpr ( ) = ma
316+ )
317+ or
318+ exists ( Method m , AndroidReceiveIntentMethod rI |
319+ m .overrides * ( rI ) and
320+ this .asParameter ( ) = m .getParameter ( 1 )
321+ )
348322 )
349323 }
350324
351- override string getSourceType ( ) { result = "Android intent extra " }
325+ override string getSourceType ( ) { result = "Android intent source " }
352326}
0 commit comments