mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
22 lines
631 B
Plaintext
22 lines
631 B
Plaintext
import rust
|
|
import codeql.rust.dataflow.DataFlow
|
|
import codeql.rust.Concepts
|
|
import utils.test.InlineFlowTest
|
|
|
|
/**
|
|
* Configuration for flow from any threat model source to an argument of the function `sink`.
|
|
*/
|
|
module MyFlowConfig implements DataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelSource }
|
|
|
|
predicate isSink(DataFlow::Node sink) {
|
|
any(CallExpr call | call.getFunction().(PathExpr).getResolvedPath() = "crate::test::sink")
|
|
.getArgList()
|
|
.getAnArg() = sink.asExpr().getExpr()
|
|
}
|
|
}
|
|
|
|
module MyFlowTest = TaintFlowTest<MyFlowConfig>;
|
|
|
|
import MyFlowTest
|