mirror of
https://github.com/github/codeql.git
synced 2025-12-20 02:44:30 +01:00
23 lines
665 B
Plaintext
23 lines
665 B
Plaintext
import python
|
|
import semmle.python.dataflow.DataFlow
|
|
|
|
class TestConfiguration extends TaintTracking::Configuration {
|
|
TestConfiguration() { this = "Test configuration" }
|
|
|
|
override predicate isSource(DataFlow::Node source, TaintKind kind) {
|
|
source.asCfgNode().(NameNode).getId() = "SOURCE" and kind instanceof DataFlowType
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node sink, TaintKind kind) {
|
|
exists(CallNode call |
|
|
call.getFunction().(NameNode).getId() = "SINK" and
|
|
sink.asCfgNode() = call.getAnArg()
|
|
) and
|
|
kind instanceof DataFlowType
|
|
}
|
|
}
|
|
|
|
private class DataFlowType extends TaintKind {
|
|
DataFlowType() { this = "Data flow" }
|
|
}
|