-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathPartialPathsFromSource.ql
More file actions
38 lines (30 loc) · 1.04 KB
/
PartialPathsFromSource.ql
File metadata and controls
38 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @name Partial Path Query from Source
* @kind path-problem
* @problem.severity warning
* @security-severity 1.0
* @sub-severity low
* @precision low
* @id js/debugging/partial-path-from-source
* @tags debugging
*/
import javascript
import ghsl
import DataFlow
// Partial Graph
module PartialFlowConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
source instanceof AllSources
}
predicate isSink(DataFlow::Node sink) { none() }
}
int explorationLimit() { result = 10 }
private module PartialFlows = DataFlow::Global<PartialFlowConfig>;
private module PartialFlowsGraph = PartialFlows::FlowExplorationFwd<explorationLimit/0>;
private import PartialFlowsGraph::PartialPathGraph
from PartialFlowsGraph::PartialPathNode source, PartialFlowsGraph::PartialPathNode sink
where
/// Filter by location
// filterByLocation(source.getNode(), "main.js", _) and
PartialFlowsGraph::partialFlow(source, sink, _)
select sink.getNode(), source, sink, "Partial Graph $@.", source.getNode(), "user-provided value"