mirror of
https://github.com/github/codeql.git
synced 2026-07-21 19:22:02 +02:00
26 lines
671 B
Plaintext
26 lines
671 B
Plaintext
import python
|
|
|
|
import semmle.python.security.TaintTracking
|
|
|
|
query predicate edges(TaintedNode fromnode, TaintedNode tonode) {
|
|
fromnode.getASuccessor() = tonode
|
|
}
|
|
|
|
private TaintedNode first_child(TaintedNode parent) {
|
|
result.getContext().getCaller() = parent.getContext() and
|
|
parent.getASuccessor() = result
|
|
}
|
|
|
|
private TaintedNode next_sibling(TaintedNode child) {
|
|
child.getASuccessor() = result and
|
|
child.getContext() = result.getContext()
|
|
}
|
|
|
|
query predicate parents(TaintedNode child, TaintedNode parent) {
|
|
child = first_child(parent) or
|
|
exists(TaintedNode prev |
|
|
parents(prev, parent) and
|
|
child = next_sibling(child)
|
|
)
|
|
}
|