File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
python/ql/lib/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -411,21 +411,16 @@ module Flask {
411
411
/** An `FileStorage` instance that originates from a flask request. */
412
412
private class FlaskRequestFileStorageInstances extends Werkzeug:: FileStorage:: InstanceSource {
413
413
FlaskRequestFileStorageInstances ( ) {
414
- // TODO: this currently only works in local-scope, since writing type-trackers for
415
- // this is a little too much effort. Once API-graphs are available for more
416
- // things, we can rewrite this.
417
- //
418
414
// TODO: This approach for identifying member-access is very adhoc, and we should
419
415
// be able to do something more structured for providing modeling of the members
420
416
// of a container-object.
421
- exists ( DataFlow :: Node files | files = request ( ) .getMember ( "files" ) . getAUse ( ) |
422
- this .asCfgNode ( ) .( SubscriptNode ) .getObject ( ) = files .asCfgNode ( )
417
+ exists ( API :: Node files | files = request ( ) .getMember ( "files" ) |
418
+ this .asCfgNode ( ) .( SubscriptNode ) .getObject ( ) = files .getAUse ( ) . asCfgNode ( )
423
419
or
424
- this . ( DataFlow :: MethodCallNode ) . calls ( files , "get" )
420
+ this = files . getMember ( "get" ) . getACall ( )
425
421
or
426
- exists ( DataFlow:: MethodCallNode getlistCall | getlistCall .calls ( files , "getlist" ) |
427
- this .asCfgNode ( ) .( SubscriptNode ) .getObject ( ) = getlistCall .asCfgNode ( )
428
- )
422
+ this .asCfgNode ( ) .( SubscriptNode ) .getObject ( ) =
423
+ files .getMember ( "getlist" ) .getReturn ( ) .getAUse ( ) .asCfgNode ( )
429
424
)
430
425
}
431
426
}
You can’t perform that action at this time.
0 commit comments