Further improvements to reporting #260
Replies: 4 comments 3 replies
-
Good ideas! My priority order for these would be
The complexity of implementing these roughly follows the same order? |
Beta Was this translation helpful? Give feedback.
-
In addition to the above ideas I think we should also consider: |
Beta Was this translation helpful? Give feedback.
-
I generally agree with Vinayak's value assessment, but maybe not with complexity.
|
Beta Was this translation helpful? Give feedback.
-
Regarding full propagation reporting, we'll want to decide if it's worth it to report every propagation path between a source and a sink, or if it's okay to tell a user that they need to run it again to verify. E.g., considering: func Foo(s Source){
output, err := doSomethingFancy(s)
if err != nil {
Sink("oh no, %v %v", output, err)
}
} We have propagation paths of |
Beta Was this translation helpful? Give feedback.
-
A recent PR #204 implemented better formatting for report messages, as well as the possibility of using a custom message, which is printed after the generic report message.
I am starting this discussion to discuss how reporting could be further improved. The following are some of my ideas, I encourage you to add your own and we can discuss what improvements we want to make.
Report source types
Reports currently do not include the type of the source, but it is common to have multiple different values wrapped into a single line, such that it can sometimes be difficult to identify which one is the source:
Having the type would also help determine which matcher triggered the propagation.
Report sources a single time
With the current reporting scheme, we produce one report for each sink that is reachable from a given source:
This feels a bit noisy to me, since the source information is duplicated. I think it would be preferable to produce the report at the position of the source, and to list the sinks afterward:
Including the names of the sinks in the report may also be useful.
Only report the file path once
Since the analysis is intraprocedural, it is impossible for a source and sink to be in separate files, and in fact, in separate functions. This will change when we implement interprocedural analysis, but for the time being, reporting the path more than once is redundant.
Expose a flag to report the full propagation
Currently, we only report the beginning (source) and end (sink) of a propagation. To properly assess whether taint can actually reach a sink, it is therefore necessary to reconstruct the taint propagation path manually. In addition to the source and sink, it would be useful to report the full propagation path, which essentially means dumping the
Propagation.preOrder
(that won't actually work, but that would be an implementation detail - one approach would be to record additional info during the traversal and use that to reconstruct the path afterwards). This would make it much easier to determine exactly how a source reached a sink. Since it is unreasonable to assume that users of the tool will be familiar with thessa
package, this flag should be off by default. However, it should be possible for users to turn it on if they wish. From personal experience, I believe such an option would be very useful.Beta Was this translation helpful? Give feedback.
All reactions