Skip to content

Tracing data flow through Javascript class properties #177

Answered by asgerf
jason-invision asked this question in General
Discussion options

You must be logged in to vote

@jason-invision I think I recognize this problem, and you might be running into a limitation in how we track flow through getters. We're working on a general fix to this, but in the meantime you can try include this snippet in your query to patch up the call graph:

private predicate accessorCall(DataFlow::PropRead read, DataFlow::FunctionNode callee) {
  exists(DataFlow::ClassNode cls, string name |
    read = cls.getAnInstanceReference().getAPropertyRead(name) and
    callee = cls.getADirectSuperClass*().getInstanceMember(name, DataFlow::MemberKind::getter())
  )
}

private class AccessorCallPatch extends DataFlow::MethodCallNode {
  override Function getACallee(int imprecision) {
    re…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jason-invision
Comment options

Comment options

You must be logged in to vote
2 replies
@asgerf
Comment options

@jason-invision
Comment options

Answer selected by jason-invision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants