Python: Fix Flask request.files modeling

This commit is contained in:
Rasmus Wriedt Larsen
2022-05-02 14:14:29 +02:00
parent 0c62916af5
commit fb0133d276
2 changed files with 2 additions and 2 deletions

View File

@@ -418,7 +418,7 @@ module Flask {
// TODO: This approach for identifying member-access is very adhoc, and we should
// be able to do something more structured for providing modeling of the members
// of a container-object.
exists(DataFlow::AttrRead files | files = request().getMember("files").getAnImmediateUse() |
exists(DataFlow::Node files | files = request().getMember("files").getAUse() |
this.asCfgNode().(SubscriptNode).getObject() = files.asCfgNode()
or
this.(DataFlow::MethodCallNode).calls(files, "get")

View File

@@ -204,7 +204,7 @@ def test_taint(name = "World!", number="0", foo="foo"): # $requestHandler route
b.getlist('key'), # $ tainted
gl('key'), # $ tainted
files.get('key').filename, # $ MISSING: tainted
files.get('key').filename, # $ tainted
)
# aliasing tests