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
In this example everything coming from the env is tainted. However, I do not want to find a taint path that starts at fn0 (where we have the env propread), but from source.
I came up with the following config that uses isAdditionalFlowStep to check whether the current function has a call to a function where an env propread is made:
This finds the taint path source -> fn0, but not source->fn1->fn0.
I am not sure how to restructure the predicate to introduce these taint steps in a recursive manner.
The text was updated successfully, but these errors were encountered:
This gets you two results (source -> fn0 and fn1 -> fn0). Note that source -> fn0 covers both the path directly to fn0 as well as via fn1.
If you further want to see every path from a function that (transitively) calls another that reads from environment variables, then you could look at CallGraph.qll for inspiration.
Hey @mbg, thanks for the suggestion! That definitely helps, and I also just noticed the bug in my isAdditionalFlowStep predicate that I shared above. I forgot to add the taint propagator from CallNode to FunctionNode:
I think thats why source -> fn1 -> fn0 was not shown.
Here is the fixed version that "preserves" this information about the call graph in a path query. I am not sure if this is the best way to solve the problem, but a quick test showed that it seems to work in the example above.
I have the following code:
In this example everything coming from the env is tainted. However, I do not want to find a taint path that starts at
fn0
(where we have the env propread), but fromsource
.I came up with the following config that uses
isAdditionalFlowStep
to check whether the current function has a call to a function where an env propread is made:This finds the taint path
source
->fn0
, but notsource
->fn1
->fn0
.I am not sure how to restructure the predicate to introduce these taint steps in a recursive manner.
The text was updated successfully, but these errors were encountered: