FlowDroid
FlowDroid copied to clipboard
the taint path analysis can't cover parent class method?
when I want to check a source-sink path with follows, I can't get any results:
<method signature="<android.app.Activity: android.content.Intent getIntent()>">
<return type="android.content.Intent">
<accessPath isSource="true" isSink="false" />
</return>
</method>
<method signature="<android.app.Activity: void startActivity(android.content.Intent)>">
<param index="0" type="android.content.Intent">
<accessPath isSource="false" isSink="true">
</accessPath>
</param>
</method>
But when change the source to:
<method signature="<com.example.myapplication.MainActivity: android.content.Intent getIntent()>">
<return type="android.content.Intent">
<accessPath isSource="true" isSink="false" />
</return>
</method>
The FlowDroid can get the correct taint path from getIntent() to startActivity(). So, the taint analysis can't cover the source method when it is defined in parent class?
getIntent
is a special case, because we handle inter-component communication explicitly through call graph edges between methods such as startActivity
and the lifecycle of the receiver activity. The getIntent
method therefore accesses the incoming intent object that was passed to startActivity
. We implemented this handling by overriding the getIntent
method in the target activity, so technically, this is no longer android.app.Activity.getIntent()
. I see that it would make sense to have some special handling inside the AndroidSourceSinkManager
to also take the overridden inherited method in that case, and not only look at the code that is immediately being calle. Can you have a look at AndroidSourceSinkManager
and propose a fix as a merge request?