@@ -22,27 +22,16 @@ private module Tornado {
22
22
/** Gets a reference to the `tornado` module. */
23
23
API:: Node tornado ( ) { result = API:: moduleImport ( "tornado" ) }
24
24
25
- /**
26
- * Gets a reference to the attribute `attr_name` of the `tornado` module.
27
- * WARNING: Only holds for a few predefined attributes.
28
- */
29
- private API:: Node tornado_attr ( string attr_name ) { result = tornado ( ) .getMember ( attr_name ) }
30
-
31
25
/** Provides models for the `tornado` module. */
32
26
module tornado {
33
27
// -------------------------------------------------------------------------
34
28
// tornado.web
35
29
// -------------------------------------------------------------------------
36
30
/** Gets a reference to the `tornado.web` module. */
37
- API:: Node web ( ) { result = tornado_attr ( "web" ) }
31
+ API:: Node web ( ) { result = tornado ( ) . getMember ( "web" ) }
38
32
39
33
/** Provides models for the `tornado.web` module */
40
34
module web {
41
- /**
42
- * Gets a reference to the attribute `attr_name` of the `tornado.web` module.
43
- * WARNING: Only holds for a few predefined attributes.
44
- */
45
- private API:: Node web_attr ( string attr_name ) { result = web ( ) .getMember ( attr_name ) }
46
35
47
36
/**
48
37
* Provides models for the `tornado.web.RequestHandler` class and subclasses.
@@ -51,7 +40,7 @@ private module Tornado {
51
40
*/
52
41
module RequestHandler {
53
42
/** Gets a reference to the `tornado.web.RequestHandler` class or any subclass. */
54
- API:: Node subclassRef ( ) { result = web_attr ( "RequestHandler" ) .getASubclass * ( ) }
43
+ API:: Node subclassRef ( ) { result = web ( ) . getMember ( "RequestHandler" ) .getASubclass * ( ) }
55
44
56
45
/** A RequestHandler class (most likely in project code). */
57
46
class RequestHandlerClass extends Class {
@@ -198,7 +187,7 @@ private module Tornado {
198
187
*/
199
188
module Application {
200
189
/** Gets a reference to the `tornado.web.Application` class. */
201
- API:: Node classRef ( ) { result = web_attr ( "Application" ) }
190
+ API:: Node classRef ( ) { result = web ( ) . getMember ( "Application" ) }
202
191
203
192
/**
204
193
* A source of instances of `tornado.web.Application`, extend this class to model new instances.
@@ -246,15 +235,10 @@ private module Tornado {
246
235
// tornado.httputil
247
236
// -------------------------------------------------------------------------
248
237
/** Gets a reference to the `tornado.httputil` module. */
249
- API:: Node httputil ( ) { result = tornado_attr ( "httputil" ) }
238
+ API:: Node httputil ( ) { result = tornado ( ) . getMember ( "httputil" ) }
250
239
251
240
/** Provides models for the `tornado.httputil` module */
252
241
module httputil {
253
- /**
254
- * Gets a reference to the attribute `attr_name` of the `tornado.httputil` module.
255
- * WARNING: Only holds for a few predefined attributes.
256
- */
257
- private API:: Node httputil_attr ( string attr_name ) { result = httputil ( ) .getMember ( attr_name ) }
258
242
259
243
/**
260
244
* Provides models for the `tornado.httputil.HttpServerRequest` class
@@ -263,7 +247,7 @@ private module Tornado {
263
247
*/
264
248
module HttpServerRequest {
265
249
/** Gets a reference to the `tornado.httputil.HttpServerRequest` class. */
266
- API:: Node classRef ( ) { result = httputil_attr ( "HttpServerRequest" ) }
250
+ API:: Node classRef ( ) { result = httputil ( ) . getMember ( "HttpServerRequest" ) }
267
251
268
252
/**
269
253
* A source of instances of `tornado.httputil.HttpServerRequest`, extend this class to model new instances.
@@ -284,26 +268,27 @@ private module Tornado {
284
268
}
285
269
286
270
/** Gets a reference to an instance of `tornado.httputil.HttpServerRequest`. */
287
- private DataFlow:: Node instance ( DataFlow:: TypeTracker t ) {
271
+ private DataFlow:: LocalSourceNode instance ( DataFlow:: TypeTracker t ) {
288
272
t .start ( ) and
289
273
result instanceof InstanceSource
290
274
or
291
275
exists ( DataFlow:: TypeTracker t2 | result = instance ( t2 ) .track ( t2 , t ) )
292
276
}
293
277
294
278
/** Gets a reference to an instance of `tornado.httputil.HttpServerRequest`. */
295
- DataFlow:: Node instance ( ) { result = instance ( DataFlow:: TypeTracker:: end ( ) ) }
279
+ DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
280
+
296
281
297
282
/** Gets a reference to the `full_url` method. */
298
- private DataFlow:: Node full_url ( DataFlow:: TypeTracker t ) {
283
+ private DataFlow:: LocalSourceNode full_url ( DataFlow:: TypeTracker t ) {
299
284
t .startInAttr ( "full_url" ) and
300
285
result = instance ( )
301
286
or
302
287
exists ( DataFlow:: TypeTracker t2 | result = full_url ( t2 ) .track ( t2 , t ) )
303
288
}
304
289
305
290
/** Gets a reference to the `full_url` method. */
306
- DataFlow:: Node full_url ( ) { result = full_url ( DataFlow:: TypeTracker:: end ( ) ) }
291
+ DataFlow:: Node full_url ( ) { full_url ( DataFlow:: TypeTracker:: end ( ) ) . flowsTo ( result ) }
307
292
308
293
private class AdditionalTaintStep extends TaintTracking:: AdditionalTaintStep {
309
294
override predicate step ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
0 commit comments