mirror of
https://github.com/github/codeql.git
synced 2025-12-24 20:56:33 +01:00
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
import javascript
|
|
|
|
class Configuration extends DataFlow::Configuration {
|
|
Configuration() { this = "PromiseDataFlowFlowTestingConfig" }
|
|
|
|
override predicate isSource(DataFlow::Node source) {
|
|
source.getEnclosingExpr().getStringValue() = "source"
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node sink) {
|
|
any(DataFlow::InvokeNode call | call.getCalleeName() = "sink").getAnArgument() = sink
|
|
}
|
|
}
|
|
|
|
class TaintConfig extends TaintTracking::Configuration {
|
|
TaintConfig() { this = "PromiseTaintFlowTestingConfig" }
|
|
|
|
override predicate isSource(DataFlow::Node source) {
|
|
source.getEnclosingExpr().getStringValue() = "source"
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node sink) {
|
|
any(DataFlow::InvokeNode call | call.getCalleeName() = "sink").getAnArgument() = sink
|
|
}
|
|
}
|
|
|
|
query predicate flow(DataFlow::Node source, DataFlow::Node sink) {
|
|
any(Configuration c).hasFlow(source, sink)
|
|
}
|
|
|
|
query predicate exclusiveTaintFlow(DataFlow::Node source, DataFlow::Node sink) {
|
|
not any(Configuration c).hasFlow(source, sink) and
|
|
any(TaintConfig c).hasFlow(source, sink)
|
|
} |