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
Reduces false positives.
As an example:
result = "a" if TAINT else "c"
In AST, the assignment value is `IfExp(test=TAINT, body="a", orelse="c")`.
Even though `TAINT` is inside the assignment of `result`, it can't
actually taint `result` as it is part of the boolean test expression.
Previously, `result` would have been tainted, which was a false
positive.
We don't want to completely ignore the test though in case it contains a
sink function.
Therefore, if the test contains expressions we transform it as so:
result = "a" if b(c) + 2 else "d"
to the multi line:
__if_exp_0 = b(c) + 2
result = "a" if __if_exp_0 else "d"
This way if `b` is a sink and `c` is tainted we see a vulnerability, but
even if `c` is tainted we don't taint `result`.
0 commit comments