File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/semmle/python/frameworks
test/library-tests/frameworks/aiohttp Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,18 @@ module AiohttpWebModel {
444
444
AiohttpRequestMultiDictProxyInstances ( ) {
445
445
this .( DataFlow:: AttrRead ) .getObject ( ) = Request:: instance ( ) and
446
446
this .( DataFlow:: AttrRead ) .getAttributeName ( ) in [ "query" , "headers" ]
447
+ or
448
+ // Handle the common case of `x = await request.post()`
449
+ // but don't try to handle anything else, since we don't have an easy way to do this yet.
450
+ // TODO: more complete handling of `await request.post()`
451
+ exists ( Await await , DataFlow:: CallCfgNode call , DataFlow:: AttrRead read |
452
+ this .asExpr ( ) = await
453
+ |
454
+ read .( DataFlow:: AttrRead ) .getObject ( ) = Request:: instance ( ) and
455
+ read .( DataFlow:: AttrRead ) .getAttributeName ( ) = "post" and
456
+ call .getFunction ( ) = read and
457
+ await .getValue ( ) = call .asExpr ( )
458
+ )
447
459
}
448
460
}
449
461
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ async def test_taint(request: web.Request): # $ requestHandler
104
104
105
105
# multidict.MultiDictProxy[str] (see `multidict` framework tests)
106
106
await request .post (), # $ tainted
107
- (await request .post ()).getone ("key" ), # $ MISSING: tainted
107
+ (await request .post ()).getone ("key" ), # $ tainted
108
108
)
109
109
110
110
import yarl
You can’t perform that action at this time.
0 commit comments