Skip to content

[JavaScript] Can I find out all the intermediate nodes on the paths from Source to Sink through CodeQL? #16659

Answered by erik-krogh
HJX-zhanS asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure I quite get what you're trying to do (or why).
But I still think I can help.

The problem (I think) is that the dataflow configuration tracks back to the before_execs, but not its properties.

If you add isAdditionalTaintStep like I've done below, then you'll track taint from any property-write into the object that's being written to.
This is not a pretty solution, and it might cause a lot of imprecision, but it could get you started.

import javascript
import DataFlow::PathGraph

class ExecDataFlowConfig extends TaintTracking::Configuration {
  ExecDataFlowConfig() { this = "ExecDataFlowConfig" }

  override predicate isSource(DataFlow::Node source) { any() }

  override predicate

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@HJX-zhanS
Comment options

@erik-krogh
Comment options

Answer selected by HJX-zhanS
@HJX-zhanS
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants