mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
JS: Port HeuristicSource test
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
legacyDataFlowDifference
|
||||
consistencyIssue
|
||||
|
||||
@@ -2,12 +2,28 @@ import javascript
|
||||
private import semmle.javascript.heuristics.AdditionalSources
|
||||
import testUtilities.ConsistencyChecking
|
||||
|
||||
class Taint extends TaintTracking::Configuration {
|
||||
Taint() { this = "Taint" }
|
||||
module TestConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node node) { node instanceof HeuristicSource }
|
||||
|
||||
override predicate isSource(DataFlow::Node node) { node instanceof HeuristicSource }
|
||||
|
||||
override predicate isSink(DataFlow::Node node) {
|
||||
predicate isSink(DataFlow::Node node) {
|
||||
node = any(DataFlow::CallNode call | call.getCalleeName() = "sink").getAnArgument()
|
||||
}
|
||||
}
|
||||
|
||||
module TestFlow = TaintTracking::Global<TestConfig>;
|
||||
|
||||
class Consistency extends ConsistencyConfiguration {
|
||||
Consistency() { this = "Consistency" }
|
||||
|
||||
override DataFlow::Node getAnAlert() { TestFlow::flowTo(result) }
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user