Detecting flow from a function parameter field to a member of a class (java) #13160
Answered
by
atorralba
yuval-piiano
asked this question in
Q&A
-
Hi, I have this Code:
and I would like to find the flow from email parameter to the emailAddress of Customer ,
and I can confirm that they mark the correct nodes, but I guess the .getFrom() access breaks the flow and there is no result for the flow I am trying to find, any idea how to do this? Thanks, |
Beta Was this translation helpful? Give feedback.
Answered by
atorralba
May 15, 2023
Replies: 1 comment
-
You need to tell CodeQL that the override predicate isAdditionalTaintStep(DataFlow::Node n1, DataFlow::Node n2) {
exists(MethodAccess ma | ma.getMethod().hasName("getFrom") | // further restrict the method here as you see fit (e.g. declaring type)
n1.asExpr() = ma.getQualifier() and
n2.asExpr() = ma
)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yuval-piiano
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to tell CodeQL that the
getFrom
method propagates taint from theemail
object. You can do that with an additional taint step: