@@ -50,22 +50,22 @@ predicate externallyDefinedSource(DataFlow::Node source, string sourceType, stri
50
50
) and
51
51
(
52
52
if fieldName .trim ( ) .matches ( "env.%" )
53
- then source .asExpr ( ) = uses .getEnvExpr ( fieldName .trim ( ) .replaceAll ( "env\\ ." , "" ) )
53
+ then source .asExpr ( ) = uses .getEnvExpr ( fieldName .trim ( ) .replaceAll ( "env." , "" ) )
54
54
else
55
55
if fieldName .trim ( ) .matches ( "output.%" )
56
- then
57
- // 'output.' is the default qualifier
58
- source .asExpr ( ) = uses
56
+ then source .asExpr ( ) = uses
59
57
else none ( )
60
58
) and
61
59
sourceType = kind
62
60
)
63
61
}
64
62
65
- predicate externallyDefinedSummary ( DataFlow:: Node pred , DataFlow:: Node succ , DataFlow:: ContentSet c ) {
63
+ predicate externallyDefinedStoreStep (
64
+ DataFlow:: Node pred , DataFlow:: Node succ , DataFlow:: ContentSet c
65
+ ) {
66
66
exists ( UsesExpr uses , string action , string version , string input , string output |
67
- c = any ( DataFlow:: FieldContent ct | ct .getName ( ) = output .replaceAll ( "output\\." , "" ) ) and
68
67
summaryModel ( action , version , input , output , "taint" ) and
68
+ c = any ( DataFlow:: FieldContent ct | ct .getName ( ) = output .replaceAll ( "output." , "" ) ) and
69
69
uses .getCallee ( ) = action .toLowerCase ( ) and
70
70
(
71
71
if version .trim ( ) = "*"
@@ -74,10 +74,11 @@ predicate externallyDefinedSummary(DataFlow::Node pred, DataFlow::Node succ, Dat
74
74
) and
75
75
(
76
76
if input .trim ( ) .matches ( "env.%" )
77
- then pred .asExpr ( ) = uses .getEnvExpr ( input .trim ( ) .replaceAll ( "env\\ ." , "" ) )
77
+ then pred .asExpr ( ) = uses .getEnvExpr ( input .trim ( ) .replaceAll ( "env." , "" ) )
78
78
else
79
- // 'input.' is the default qualifier
80
- pred .asExpr ( ) = uses .getArgumentExpr ( input .trim ( ) .replaceAll ( "input\\." , "" ) )
79
+ if input .trim ( ) .matches ( "input.%" )
80
+ then pred .asExpr ( ) = uses .getArgumentExpr ( input .trim ( ) .replaceAll ( "input." , "" ) )
81
+ else none ( )
81
82
) and
82
83
succ .asExpr ( ) = uses
83
84
)
@@ -87,8 +88,11 @@ predicate externallyDefinedSink(DataFlow::ExprNode sink, string kind) {
87
88
exists ( UsesExpr uses , string action , string version , string input |
88
89
(
89
90
if input .trim ( ) .matches ( "env.%" )
90
- then sink .asExpr ( ) = uses .getEnvExpr ( input .trim ( ) .replaceAll ( "input\\." , "" ) )
91
- else sink .asExpr ( ) = uses .getArgumentExpr ( input .trim ( ) )
91
+ then sink .asExpr ( ) = uses .getEnvExpr ( input .trim ( ) .replaceAll ( "env." , "" ) )
92
+ else
93
+ if input .trim ( ) .matches ( "input.%" )
94
+ then sink .asExpr ( ) = uses .getArgumentExpr ( input .trim ( ) .replaceAll ( "input." , "" ) )
95
+ else none ( )
92
96
) and
93
97
sinkModel ( action , version , input , kind ) and
94
98
uses .getCallee ( ) = action .toLowerCase ( ) and
0 commit comments