-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missed sinks with lists and statements uninvolved in the taint path including negative numbers #767
Comments
Lines 83 to 90 in dd2de62
Quite sure the bug is in the lines above. The comment states that no aliases should be killed here, however, the code proceeds to ask the must alias analysis whether the lhs and the taint are aliases. Replacing the function call with a simple equals check fixes your issue. However, I didn't test this change, so it might break other things. |
Using the current version of FlowDroid (including up to the latest commit e8b193e), it still misses the sink but the statement |
I tinkered around a little and discovered that this issue only happens if the uninvolved list is not used in between instantiation and the sink. If we add any statement involving the list, FlowDroid correctly reports the leak: public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<String> taint_list = new ArrayList<String>();
taint_list.add(source());
List<Boolean> unused2 = new ArrayList<Boolean>();
System.out.println(unused2); // If this statement is removed, FlowDroid doesn't report the leak in the next statement
sink(taint_list);
} |
I ran into an issue where FlowDroid misses a leak if some statements that don't affect the propagation are added.
Please consider the following example-code where FlowDroid misses the sink at the end of
onCreate
:As annotated, if one of the two statements not related to the taint path is removed (or changed), FlowDroid finds the leak.
I run FlowDroid via the command-line tool with
If relevant, my SourcesAndSinks.xml looks like this
The text was updated successfully, but these errors were encountered: