Skip to content

Analyzing library code for dangerous flows #7537

Answered by smowton
vlkl-sap asked this question in Q&A
Discussion options

You must be logged in to vote

You have a couple of choices here:

If pt is never user controlled, or if it is but its argument never reaches a sink without going back into user code (e.g. in the example you gave, the user would have to write mmm(pt(userControlled))), classify the argument to mmm as a source, not pt. You could manually enumerate these functions, or use polyCalls*(someSinkMethod) to approximate methods that can reach a sink.

The trickiest case is when pt isn't as simple as you depict, but can be both a source and a propagator of taint. For example, if the real function looks like

public static String pt(String str) {
  if(someCond)
    maybeSink(str);
  return str;
}

Then we really do need to consider str

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by vlkl-sap
Comment options

You must be logged in to vote
1 reply
@smowton
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants