mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Fix Flask request.files modeling
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user