mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
JS: Update Redux test
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
legacyDataFlowDifference
|
||||
reducerArg
|
||||
| exportedReducer.js:12:12:12:35 | (state, ... > state |
|
||||
| react-redux.jsx:12:33:17:9 | (state, ... } |
|
||||
|
||||
@@ -44,20 +44,28 @@ query predicate reducerToStateStep = Redux::reducerToStateStep/2;
|
||||
|
||||
query Redux::StoreCreation storeCreation() { any() }
|
||||
|
||||
class BasicTaint extends TaintTracking::Configuration {
|
||||
BasicTaint() { this = "BasicTaint" }
|
||||
module TestConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node node) { node.(DataFlow::CallNode).getCalleeName() = "source" }
|
||||
|
||||
override predicate isSource(DataFlow::Node node) {
|
||||
node.(DataFlow::CallNode).getCalleeName() = "source"
|
||||
}
|
||||
|
||||
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 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>
|
||||
|
||||
query predicate taintFlow(DataFlow::Node source, DataFlow::Node sink) {
|
||||
any(BasicTaint cfg).hasFlow(source, sink)
|
||||
TestFlow::flow(source, sink)
|
||||
}
|
||||
|
||||
query DataFlow::SourceNode reactComponentRef(ReactComponent component) {
|
||||
|
||||
Reference in New Issue
Block a user