Python: aiohttp match_info should be tainted

Whoops
This commit is contained in:
Rasmus Wriedt Larsen
2021-05-26 16:05:36 +02:00
parent 597a9dfc80
commit 63c7fa0c2c
2 changed files with 6 additions and 2 deletions

View File

@@ -19,6 +19,11 @@ async def test_taint(request: web.Request): # $ requestHandler
request.path_qs, # $ tainted
request.raw_path, # $ tainted
# dict-like for captured parts of the URL
request.match_info, # $ tainted
request.match_info["key"], # $ tainted
request.match_info.get("key"), # $ tainted
# multidict.MultiDictProxy[str]
# see https://multidict.readthedocs.io/en/stable/multidict.html#multidict.MultiDictProxy
# TODO: Should have a better way to capture that we in fact _do_ model this as a
@@ -121,7 +126,6 @@ async def test_taint(request: web.Request): # $ requestHandler
ensure_not_tainted(
request.loop,
request.match_info,
request.app,
request.config_dict,
)