Skip to content

Is there a CodeQL query that finds ALL sources and sinks with their function bodies and Flow? #850

Closed Answered by jketema
akanksha1131 asked this question in Q&A
Discussion options

You must be logged in to vote

That's called a path, not the output of a select. Roughly, if you want to create something like this yourself, you'll need to write a query that has the following structure:

/**
 * @kind path-problem
 */

class NodeType { ... }

query predicate edges(NodeType a, NodeType b) {
  // should hold if there is a step from a to b
}

query predicate nodes(NodeType n, string key, string val) {
    // if n is a node along a path
    and key = "semmle.label" and val = n.toString()
}

from ...
where ...
select sink, source, sink, "..."

Dataflow queries have such a structure, but the edges and nodes query predicates are imported under the hood in that case, so you don't have to implement them. There s…

Replies: 2 comments 6 replies

Comment options

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

@jketema
Comment options

jketema Nov 7, 2024
Collaborator

Answer selected by jketema
Comment options

You must be logged in to vote
4 replies
@jketema
Comment options

jketema Nov 11, 2024
Collaborator

@akanksha1131
Comment options

@jketema
Comment options

jketema Nov 12, 2024
Collaborator

@akanksha1131
Comment options

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