Skip to content

Commit 27e61a1

Browse files
committed
JS: Also update cheat sheet
1 parent 89463d7 commit 27e61a1

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docs/codeql/codeql-language-guides/data-flow-cheat-sheet-for-javascript.rst

+9-10
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ Use the following template to create a taint tracking path query:
1616
* @kind path-problem
1717
*/
1818
import javascript
19-
import DataFlow
20-
import DataFlow::PathGraph
21-
22-
class MyConfig extends TaintTracking::Configuration {
23-
MyConfig() { this = "MyConfig" }
24-
override predicate isSource(Node node) { ... }
25-
override predicate isSink(Node node) { ... }
26-
override predicate isAdditionalTaintStep(Node pred, Node succ) { ... }
19+
20+
module MyConfig implements DataFlow::ConfigSig {
21+
predicate isSource(DataFlow::Node node) { ... }
22+
predicate isSink(DataFlow::Node node) { ... }
23+
predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) { ... }
2724
}
2825
29-
from MyConfig cfg, PathNode source, PathNode sink
30-
where cfg.hasFlowPath(source, sink)
26+
module MyFlow = TaintTracking::Global<MyConfig>;
27+
28+
from MyFlow::PathNode source, MyFlow::PathNode sink
29+
where MyFlow::flowPath(source, sink)
3130
select sink.getNode(), source, sink, "taint from $@.", source.getNode(), "here"
3231
3332
This query reports flow paths which:

0 commit comments

Comments
 (0)