Skip to content

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
Discussion options

You must be logged in to vote

You need to tell CodeQL that the getFrom method propagates taint from the email object. You can do that with an additional taint step:

  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
    )
  }

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
2 participants