@@ -116,38 +116,6 @@ private class MyBatisProvider extends RefType {
116
116
}
117
117
}
118
118
119
- private class MyBatisAbstractSqlMethod extends Method {
120
- string taintedArgs ;
121
- string signature ;
122
-
123
- MyBatisAbstractSqlMethod ( ) {
124
- this .getDeclaringType ( ) .getSourceDeclaration ( ) instanceof MyBatisAbstractSql and
125
- (
126
- this .hasName ( [
127
- "UPDATE" , "SET" , "INSERT_INTO" , "SELECT" , "OFFSET_ROWS" , "LIMIT" , "OFFSET" ,
128
- "FETCH_FIRST_ROWS_ONLY" , "DELETE_FROM" , "INNER_JOIN" , "ORDER_BY" , "WHERE" , "HAVING" ,
129
- "OUTER_JOIN" , "LEFT_OUTER_JOIN" , "RIGHT_OUTER_JOIN" , "GROUP_BY" , "FROM" , "SELECT_DISTINCT"
130
- ] ) and
131
- taintedArgs = "Argument[0]" and
132
- signature = "String"
133
- or
134
- this .hasName ( [
135
- "SET" , "INTO_COLUMNS" , "INTO_VALUES" , "SELECT_DISTINCT" , "FROM" , "JOIN" , "INNER_JOIN" ,
136
- "LEFT_OUTER_JOIN" , "RIGHT_OUTER_JOIN" , "OUTER_JOIN" , "WHERE" , "GROUP_BY" , "HAVING" ,
137
- "ORDER_BY"
138
- ] ) and
139
- taintedArgs = "Argument[0].ArrayElement" and
140
- signature = "String[]"
141
- or
142
- this .hasName ( "VALUES" ) and taintedArgs = "Argument[0..1]" and signature = "String,String"
143
- )
144
- }
145
-
146
- string getTaintedArgs ( ) { result = taintedArgs }
147
-
148
- string getCsvSignature ( ) { result = signature }
149
- }
150
-
151
119
/**
152
120
* A return statement of a method used in a MyBatis Provider.
153
121
*
@@ -189,12 +157,41 @@ private class MyBatisAbstractSqlToStringStep extends SummaryModelCsv {
189
157
}
190
158
}
191
159
160
+ private class MyBatisAbstractSqlMethod extends string {
161
+ string taintedArgs ;
162
+ string signature ;
163
+
164
+ MyBatisAbstractSqlMethod ( ) {
165
+ this in [
166
+ "UPDATE" , "SET" , "INSERT_INTO" , "SELECT" , "OFFSET_ROWS" , "LIMIT" , "OFFSET" ,
167
+ "FETCH_FIRST_ROWS_ONLY" , "DELETE_FROM" , "INNER_JOIN" , "ORDER_BY" , "WHERE" , "HAVING" ,
168
+ "OUTER_JOIN" , "LEFT_OUTER_JOIN" , "RIGHT_OUTER_JOIN" , "GROUP_BY" , "FROM" , "SELECT_DISTINCT"
169
+ ] and
170
+ taintedArgs = "Argument[0]" and
171
+ signature = "String"
172
+ or
173
+ this in [
174
+ "SET" , "INTO_COLUMNS" , "INTO_VALUES" , "SELECT_DISTINCT" , "FROM" , "JOIN" , "INNER_JOIN" ,
175
+ "LEFT_OUTER_JOIN" , "RIGHT_OUTER_JOIN" , "OUTER_JOIN" , "WHERE" , "GROUP_BY" , "HAVING" ,
176
+ "ORDER_BY"
177
+ ] and
178
+ taintedArgs = "Argument[0].ArrayElement" and
179
+ signature = "String[]"
180
+ or
181
+ this = "VALUES" and taintedArgs = "Argument[0..1]" and signature = "String,String"
182
+ }
183
+
184
+ string getTaintedArgs ( ) { result = taintedArgs }
185
+
186
+ string getCsvSignature ( ) { result = signature }
187
+ }
188
+
192
189
private class MyBatisAbstractSqlMethodsStep extends SummaryModelCsv {
193
190
override predicate row ( string row ) {
194
191
exists ( MyBatisAbstractSqlMethod m |
195
192
row =
196
- "org.apache.ibatis.jdbc;AbstractSQL;true;" + m . getName ( ) + ";(" + m .getCsvSignature ( ) +
197
- ");;" + m .getTaintedArgs ( ) + ";Argument[-1];taint"
193
+ "org.apache.ibatis.jdbc;AbstractSQL;true;" + m + ";(" + m .getCsvSignature ( ) + ");;" +
194
+ m .getTaintedArgs ( ) + ";Argument[-1];taint"
198
195
)
199
196
}
200
197
}
0 commit comments