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 isAdditionalTaintStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
12+ predicate isAdditionalFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
1513 exists ( DataFlow:: CallNode c |
1614 c = DataFlow:: moduleImport ( "resolve-symlinks" ) .getACall ( ) and
1715 pred = c .getArgument ( 0 ) and
@@ -20,6 +18,8 @@ class CommandLineFileNameConfiguration extends TaintTracking::Configuration {
2018 }
2119}
2220
23- from CommandLineFileNameConfiguration cfg , DataFlow:: Node source , DataFlow:: Node sink
24- where cfg .hasFlow ( source , sink )
21+ module CommandLineFileNameFlow = TaintTracking:: Global< CommandLineFileNameConfig > ;
22+
23+ from DataFlow:: Node source , DataFlow:: Node sink
24+ where CommandLineFileNameFlow:: flow ( source , sink )
2525select source , sink
0 commit comments