Replies: 1 comment 1 reply
-
Hi @Leepay, 👋 When modeling mutations in the JavaScript analysis, we usually add override predicate isAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
//track the path from Rhs to the object e.g. o.name = n; (n -> o)
exists(DataFlow::PropWrite write_prop|
pred = write_prop.getRhs() and
+ succ = write_prop.getBase().getALocalSource()
)
} Regarding your example, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The JavaScript codes are:
And I want to make
n
as my source in the TaintTracking::Configuration to find out its flows. So my codeQL query is:But when I run this query, the longest path it can track is "
n
(the argument offunc
) ->n
(in assignmento.name=n
) ->o.name=n
", which ends ato.name=n
and will not marko
as a tainted variable.So I override the
isAdditionalTaintStep
predicate like:Now the tracked flows is appended with
o
ino.name=n
. And the current path is "n
(the argument offunc
) ->n
(in assignmento.name=n
) ->o.name=n
->o
(ino.name=n
)". However, it still cannot track into the usage ofo
in CallNodeconsole.log(o)
.I also tried the
isAdditionalTaintStep
like:And the tracked path is "
n
(the argument offunc
) ->n
(in assignmento.name=n
) ->o
(ino.name=n
)", still without the CallNodeconsole.log(o)
I wonder why does this happen, is it an inner mechanism of codeQL or a mistake of my codeQL query?
Beta Was this translation helpful? Give feedback.
All reactions