@@ -138,32 +138,6 @@ private module Tornado {
138
138
/** Gets a reference to an instance of the `tornado.web.RequestHandler` class or any subclass. */
139
139
DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
140
140
141
- /** Gets a reference to one of the methods `get_argument`, `get_body_argument`, `get_query_argument`. */
142
- private DataFlow:: TypeTrackingNode argumentMethod ( DataFlow:: TypeTracker t ) {
143
- t .startInAttr ( [ "get_argument" , "get_body_argument" , "get_query_argument" ] ) and
144
- result = instance ( )
145
- or
146
- exists ( DataFlow:: TypeTracker t2 | result = argumentMethod ( t2 ) .track ( t2 , t ) )
147
- }
148
-
149
- /** Gets a reference to one of the methods `get_argument`, `get_body_argument`, `get_query_argument`. */
150
- DataFlow:: Node argumentMethod ( ) {
151
- argumentMethod ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result )
152
- }
153
-
154
- /** Gets a reference to one of the methods `get_arguments`, `get_body_arguments`, `get_query_arguments`. */
155
- private DataFlow:: TypeTrackingNode argumentsMethod ( DataFlow:: TypeTracker t ) {
156
- t .startInAttr ( [ "get_arguments" , "get_body_arguments" , "get_query_arguments" ] ) and
157
- result = instance ( )
158
- or
159
- exists ( DataFlow:: TypeTracker t2 | result = argumentsMethod ( t2 ) .track ( t2 , t ) )
160
- }
161
-
162
- /** Gets a reference to one of the methods `get_arguments`, `get_body_arguments`, `get_query_arguments`. */
163
- DataFlow:: Node argumentsMethod ( ) {
164
- argumentsMethod ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result )
165
- }
166
-
167
141
/** Gets a reference the `redirect` method. */
168
142
private DataFlow:: TypeTrackingNode redirectMethod ( DataFlow:: TypeTracker t ) {
169
143
t .startInAttr ( "redirect" ) and
@@ -190,14 +164,15 @@ private module Tornado {
190
164
191
165
private class AdditionalTaintStep extends TaintTracking:: AdditionalTaintStep {
192
166
override predicate step ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
193
- // Method access
194
- nodeTo .( DataFlow:: AttrRead ) .getObject ( ) = nodeFrom and
167
+ // normal (non-async) methods
195
168
nodeFrom = instance ( ) and
196
- nodeTo in [ argumentMethod ( ) , argumentsMethod ( ) ]
197
- or
198
- // Method call
199
- nodeTo .asCfgNode ( ) .( CallNode ) .getFunction ( ) = nodeFrom .asCfgNode ( ) and
200
- nodeFrom in [ argumentMethod ( ) , argumentsMethod ( ) ]
169
+ nodeTo
170
+ .( DataFlow:: MethodCallNode )
171
+ .calls ( nodeFrom ,
172
+ [
173
+ "get_argument" , "get_body_argument" , "get_query_argument" , "get_arguments" ,
174
+ "get_body_arguments" , "get_query_arguments"
175
+ ] )
201
176
or
202
177
// Attributes
203
178
nodeFrom = instance ( ) and
@@ -315,27 +290,11 @@ private module Tornado {
315
290
/** Gets a reference to an instance of `tornado.httputil.HttpServerRequest`. */
316
291
DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
317
292
318
- /** Gets a reference to the `full_url` method. */
319
- private DataFlow:: TypeTrackingNode full_url ( DataFlow:: TypeTracker t ) {
320
- t .startInAttr ( "full_url" ) and
321
- result = instance ( )
322
- or
323
- exists ( DataFlow:: TypeTracker t2 | result = full_url ( t2 ) .track ( t2 , t ) )
324
- }
325
-
326
- /** Gets a reference to the `full_url` method. */
327
- DataFlow:: Node full_url ( ) { full_url ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
328
-
329
293
private class AdditionalTaintStep extends TaintTracking:: AdditionalTaintStep {
330
294
override predicate step ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
331
- // Method access
332
- nodeTo .( DataFlow:: AttrRead ) .getObject ( ) = nodeFrom and
295
+ // normal (non-async) methods
333
296
nodeFrom = instance ( ) and
334
- nodeTo in [ full_url ( ) ]
335
- or
336
- // Method call
337
- nodeTo .asCfgNode ( ) .( CallNode ) .getFunction ( ) = nodeFrom .asCfgNode ( ) and
338
- nodeFrom in [ full_url ( ) ]
297
+ nodeTo .( DataFlow:: MethodCallNode ) .calls ( nodeFrom , [ "full_url" ] )
339
298
or
340
299
// Attributes
341
300
nodeFrom = instance ( ) and
0 commit comments