File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
javascript/ql/test/tutorials/Analyzing data flow in JavaScript/Global data flow Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 11import javascript
22
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 ) {
75 DataFlow:: globalVarRef ( "process" ) .getAPropertyRead ( "argv" ) .getAPropertyRead ( ) = source
86 }
97
10- override predicate isSink ( DataFlow:: Node sink ) {
8+ predicate isSink ( DataFlow:: Node sink ) {
119 DataFlow:: moduleMember ( "fs" , "readFile" ) .getACall ( ) .getArgument ( 0 ) = sink
1210 }
1311
14- override predicate isSanitizer ( DataFlow:: Node nd ) {
15- nd .( DataFlow:: CallNode ) .getCalleeName ( ) = "checkPath"
16- }
12+ predicate isBarrier ( DataFlow:: Node nd ) { nd .( DataFlow:: CallNode ) .getCalleeName ( ) = "checkPath" }
1713}
1814
19- from CommandLineFileNameConfiguration cfg , DataFlow:: Node source , DataFlow:: Node sink
20- where cfg .hasFlow ( source , sink )
15+ module CommandLineFileNameFlow = TaintTracking:: Global< CommandLineFileNameConfig > ;
16+
17+ from DataFlow:: Node source , DataFlow:: Node sink
18+ where CommandLineFileNameFlow:: flow ( source , sink )
2119select source , sink
You can’t perform that action at this time.
0 commit comments