mirror of
https://github.com/github/codeql.git
synced 2026-04-20 14:34:04 +02:00
JS: Port AsyncTaintTracking test
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
legacyDataFlowDifference
|
||||
#select
|
||||
| each.js:11:9:11:16 | source() | each.js:13:12:13:15 | item |
|
||||
| map.js:10:13:10:20 | source() | map.js:12:14:12:17 | item |
|
||||
| map.js:20:19:20:26 | source() | map.js:23:27:23:32 | result |
|
||||
|
||||
@@ -2,14 +2,24 @@ import javascript
|
||||
|
||||
DataFlow::CallNode getACall(string name) { result.getCalleeName() = name }
|
||||
|
||||
class BasicConfig extends TaintTracking::Configuration {
|
||||
BasicConfig() { this = "BasicConfig" }
|
||||
module TestConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node node) { node = getACall("source") }
|
||||
|
||||
override predicate isSource(DataFlow::Node node) { node = getACall("source") }
|
||||
|
||||
override predicate isSink(DataFlow::Node node) { node = getACall("sink").getAnArgument() }
|
||||
predicate isSink(DataFlow::Node node) { node = getACall("sink").getAnArgument() }
|
||||
}
|
||||
|
||||
from BasicConfig cfg, DataFlow::Node src, DataFlow::Node sink
|
||||
where cfg.hasFlow(src, sink)
|
||||
module TestFlow = TaintTracking::Global<TestConfig>;
|
||||
|
||||
class LegacyConfig extends TaintTracking::Configuration {
|
||||
LegacyConfig() { this = "LegacyConfig" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) { TestConfig::isSource(source) }
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { TestConfig::isSink(sink) }
|
||||
}
|
||||
|
||||
import testUtilities.LegacyDataFlowDiff::DataFlowDiff<TestFlow, LegacyConfig>
|
||||
|
||||
from DataFlow::Node src, DataFlow::Node sink
|
||||
where TestFlow::flow(src, sink)
|
||||
select src, sink
|
||||
|
||||
Reference in New Issue
Block a user