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 {
444444 AiohttpRequestMultiDictProxyInstances ( ) {
445445 this .( DataFlow:: AttrRead ) .getObject ( ) = Request:: instance ( ) and
446446 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+ )
447459 }
448460 }
449461
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ async def test_taint(request: web.Request): # $ requestHandler
104104
105105 # multidict.MultiDictProxy[str] (see `multidict` framework tests)
106106 await request .post (), # $ tainted
107- (await request .post ()).getone ("key" ), # $ MISSING: tainted
107+ (await request .post ()).getone ("key" ), # $ tainted
108108 )
109109
110110 import yarl
You can’t perform that action at this time.
0 commit comments