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 1
1
import javascript
2
2
3
- class CommandLineFileNameConfiguration extends TaintTracking:: Configuration {
4
- CommandLineFileNameConfiguration ( ) { this = "CommandLineFileNameConfiguration" }
5
-
6
- override predicate isSource ( DataFlow:: Node source ) {
3
+ module CommandLineFileNameConfig implements DataFlow:: ConfigSig {
4
+ predicate isSource ( DataFlow:: Node source ) {
7
5
DataFlow:: globalVarRef ( "process" ) .getAPropertyRead ( "argv" ) .getAPropertyRead ( ) = source
8
6
}
9
7
10
- override predicate isSink ( DataFlow:: Node sink ) {
8
+ predicate isSink ( DataFlow:: Node sink ) {
11
9
DataFlow:: moduleMember ( "fs" , "readFile" ) .getACall ( ) .getArgument ( 0 ) = sink
12
10
}
13
11
}
14
12
15
- from CommandLineFileNameConfiguration cfg , DataFlow:: Node source , DataFlow:: Node sink
16
- where cfg .hasFlow ( source , sink )
13
+ module CommandLineFileNameFlow = TaintTracking:: Global< CommandLineFileNameConfig > ;
14
+
15
+ from DataFlow:: Node source , DataFlow:: Node sink
16
+ where CommandLineFileNameFlow:: flow ( source , sink )
17
17
select source , sink
You can’t perform that action at this time.
0 commit comments