You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to model indirect flow through external functions, similar to the example below. I want to follow the taint from taint_source to taint_sink through process_taint and process_taint2. Therefore, I need to model that the taint of the data member is propagated to the outputs.
However, as far as I can see that would require to copy the rule for every member of S using the same pattern. For JS there seems to be an AnyMember keyword but it looks like this is not available in C++. Is there a wildcard to specify the same field/access path in the input and output?
Alternatively I tried to model it as an additional flow step like this
Thanks for your question. C++ does not have AnyMemberkeyword like JS does. However, from what you shared, I would assume that ignoring the fields and making your MaD rows "value-preserving" will work:
This means that dataflow will remember that data is tainted after s->data = taint_source();, and (because we modeled them as value-preserving) the calls to process_taint and process_taint2 will also imply dataflow for all the members of S.
Unfortunately, isAdditionalFlowStep cannot be used here. There's an unwritten rule here, that when the access path is non-empty (i.e., we are tracking a field that’s been written into an object, but not yet read), then the flows added via isAdditionalFlowStep aren’t used. This also explains why you needed to add
I'm trying to model indirect flow through external functions, similar to the example below. I want to follow the taint from
taint_source
totaint_sink
throughprocess_taint
andprocess_taint2
. Therefore, I need to model that the taint of thedata
member is propagated to the outputs.I use this basic query for the example
Using the following MaD I can get a correct taint flow.
However, as far as I can see that would require to copy the rule for every member of
S
using the same pattern. For JS there seems to be anAnyMember
keyword but it looks like this is not available in C++. Is there a wildcard to specify the same field/access path in the input and output?Alternatively I tried to model it as an additional flow step like this
Which finds the flows but also produces false positives where
dummy
is given totaint_sink
as it should not be tainted.How can I model the propagation of indirect data flow with the correct access path for external functions?
The text was updated successfully, but these errors were encountered: