mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
python: update debug queries
This commit is contained in:
@@ -46,6 +46,4 @@ class TestConfiguration extends DataFlow::Configuration {
|
||||
}
|
||||
|
||||
override predicate isBarrierIn(DataFlow::Node node) { this.isSource(node) }
|
||||
|
||||
override int explorationLimit() { result = 5 }
|
||||
}
|
||||
|
||||
@@ -46,6 +46,4 @@ class TestConfiguration extends TaintTracking::Configuration {
|
||||
}
|
||||
|
||||
override predicate isSanitizerIn(DataFlow::Node node) { this.isSource(node) }
|
||||
|
||||
override int explorationLimit() { result = 5 }
|
||||
}
|
||||
|
||||
@@ -9,17 +9,29 @@
|
||||
// 3. if necessary, look at partial paths by (un)commenting appropriate lines
|
||||
import python
|
||||
import semmle.python.dataflow.new.DataFlow
|
||||
import semmle.python.dataflow.new.TaintTracking
|
||||
import experimental.meta.InlineTaintTest::Conf
|
||||
// import DataFlow::PartialPathGraph
|
||||
import DataFlow::PathGraph
|
||||
|
||||
class Conf extends TestTaintTrackingConfiguration {
|
||||
// override int explorationLimit() { result = 5 }
|
||||
module Conf implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) {
|
||||
any (TestTaintTrackingConfiguration c).isSource(source)
|
||||
}
|
||||
predicate isSink(DataFlow::Node source) {
|
||||
any (TestTaintTrackingConfiguration c).isSink(source)
|
||||
}
|
||||
}
|
||||
int explorationLimit() { result = 5 }
|
||||
|
||||
// from Conf config, DataFlow::PartialPathNode source, DataFlow::PartialPathNode sink
|
||||
// where config.hasPartialFlow(source, sink, _)
|
||||
from Conf config, DataFlow::PathNode source, DataFlow::PathNode sink
|
||||
where config.hasFlowPath(source, sink)
|
||||
module Flows = TaintTracking::Global<Conf>;
|
||||
|
||||
module FlowsPartial = Flows::FlowExploration<explorationLimit/0>;
|
||||
|
||||
// import FlowsPartial::PartialPathGraph
|
||||
import Flows::PathGraph
|
||||
|
||||
// from FlowsPartial::PartialPathNode source, FlowsPartial::PartialPathNode sink
|
||||
// where FlowsPartial::partialFlow(source, sink, _)
|
||||
from Flows::PathNode source, Flows::PathNode sink
|
||||
where Flows::flowPath(source, sink)
|
||||
select sink.getNode(), source, sink, "This node receives taint from $@.", source.getNode(),
|
||||
"this source"
|
||||
|
||||
@@ -10,16 +10,25 @@
|
||||
import python
|
||||
import semmle.python.dataflow.new.DataFlow
|
||||
import experimental.dataflow.testConfig
|
||||
// import DataFlow::PartialPathGraph
|
||||
import DataFlow::PathGraph
|
||||
|
||||
class Conf extends TestConfiguration {
|
||||
override int explorationLimit() { result = 5 }
|
||||
module Conf implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { any(TestConfiguration c).isSource(source) }
|
||||
|
||||
predicate isSink(DataFlow::Node source) { any(TestConfiguration c).isSink(source) }
|
||||
}
|
||||
|
||||
// from Conf config, DataFlow::PartialPathNode source, DataFlow::PartialPathNode sink
|
||||
// where config.hasPartialFlow(source, sink, _)
|
||||
from Conf config, DataFlow::PathNode source, DataFlow::PathNode sink
|
||||
where config.hasFlowPath(source, sink)
|
||||
select sink.getNode(), source, sink, "This node receives taint from $@.", source.getNode(),
|
||||
int explorationLimit() { result = 5 }
|
||||
|
||||
module Flows = DataFlow::Global<Conf>;
|
||||
|
||||
module FlowsPartial = Flows::FlowExploration<explorationLimit/0>;
|
||||
|
||||
// import FlowsPartial::PartialPathGraph
|
||||
import Flows::PathGraph
|
||||
|
||||
// from FlowsPartial::PartialPathNode source, FlowsPartial::PartialPathNode sink
|
||||
// where FlowsPartial::partialFlow(source, sink, _)
|
||||
from Flows::PathNode source, Flows::PathNode sink
|
||||
where Flows::flowPath(source, sink)
|
||||
select sink.getNode(), source, sink, "This node receives flow from $@.", source.getNode(),
|
||||
"this source"
|
||||
|
||||
Reference in New Issue
Block a user