mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
32 lines
907 B
Plaintext
32 lines
907 B
Plaintext
import javascript
|
|
|
|
class TestDataFlowConfiguration extends DataFlow::Configuration {
|
|
TestDataFlowConfiguration() { this = "TestDataFlowConfiguration" }
|
|
|
|
override predicate isSource(DataFlow::Node src) {
|
|
exists(VariableDeclarator vd |
|
|
vd.getBindingPattern().(VarDecl).getName().matches("%source%") and
|
|
src.asExpr() = vd.getInit()
|
|
)
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node snk) {
|
|
exists(VariableDeclarator vd |
|
|
vd.getBindingPattern().(VarDecl).getName().matches("%sink%") and
|
|
snk.asExpr() = vd.getInit()
|
|
)
|
|
}
|
|
|
|
override predicate isBarrier(DataFlow::Node node) {
|
|
exists(Function f |
|
|
f.getName().matches("%noReturnTracking%") and
|
|
node = f.getAReturnedExpr().flow()
|
|
)
|
|
}
|
|
|
|
override predicate isBarrierEdge(DataFlow::Node src, DataFlow::Node snk) {
|
|
src = src and
|
|
snk.asExpr().(PropAccess).getPropertyName() = "notTracked"
|
|
}
|
|
}
|