-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java: model taint for java.util.Arrays #3894
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
Conversation
or | ||
method.getDeclaringType().hasQualifiedName("java.util", "Arrays") and | ||
( | ||
method.hasName(["copyOf", "copyOfRange", "deepToString", "spliterator", "stream", "toString"]) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the general convention regarding Object.toString()
of this project? It could be a taint step if it is overridden and includes the values of the fields of the object, but if it is not overridden or does not ouput the value of all fields or their values do not override toString()
this would cause false positives.
So if this considers deepToString
and toString
as taint steps, Object.toString()
should probably be considered as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's exclude "deepToString" and "toString" for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
or | ||
method.getDeclaringType().hasQualifiedName("java.util", "Arrays") and | ||
( | ||
method.hasName(["fill", "parallelPrefix", "parallelSetAll", "setAll"]) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"parallelPrefix", "parallelSetAll", and "setAll" won't work like this. We have yet to set up a framework for data and taint flow in library methods designed to accept lambdas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove them for now.
@aibaars I think we're missing |
Has this sort of step come up? Including this suggests that we also include |
@lcartey I got a little push back on |
@aschackmull I've seen this only in synthetic benchmarks so far. I do actually think |
Actually, on reflection, you're right - the cases are inextricably linked for arrays of |
This pull request model taint propagation for the methods of the
java.util.Arrays
class.