File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
javascript/ql/test/tutorials/Analyzing data flow in JavaScript/Global data flow Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,18 @@ class StepThroughResolveSymlinks extends TaintTracking::SharedTaintStep {
10
10
}
11
11
}
12
12
13
- class CommandLineFileNameConfiguration extends TaintTracking:: Configuration {
14
- CommandLineFileNameConfiguration ( ) { this = "CommandLineFileNameConfiguration" }
15
-
16
- override predicate isSource ( DataFlow:: Node source ) {
13
+ module CommandLineFileNameConfig implements DataFlow:: ConfigSig {
14
+ predicate isSource ( DataFlow:: Node source ) {
17
15
DataFlow:: globalVarRef ( "process" ) .getAPropertyRead ( "argv" ) .getAPropertyRead ( ) = source
18
16
}
19
17
20
- override predicate isSink ( DataFlow:: Node sink ) {
18
+ predicate isSink ( DataFlow:: Node sink ) {
21
19
DataFlow:: moduleMember ( "fs" , "readFile" ) .getACall ( ) .getArgument ( 0 ) = sink
22
20
}
23
21
}
24
22
25
- from CommandLineFileNameConfiguration cfg , DataFlow:: Node source , DataFlow:: Node sink
26
- where cfg .hasFlow ( source , sink )
23
+ module CommandLineFileNameFlow = TaintTracking:: Global< CommandLineFileNameConfig > ;
24
+
25
+ from DataFlow:: Node source , DataFlow:: Node sink
26
+ where CommandLineFileNameFlow:: flow ( source , sink )
27
27
select source , sink
You can’t perform that action at this time.
0 commit comments