Skip to content

Commit 3dc0c20

Browse files
committed
Python: Fix taint-propagation to methods
Before we would add a step from _any_ request instance to _any_ method (CP).
1 parent 721ba5e commit 3dc0c20

File tree

1 file changed

+2
-1
lines changed
  • python/ql/src/semmle/python/frameworks

1 file changed

+2
-1
lines changed

python/ql/src/semmle/python/frameworks/Flask.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ module Flask {
351351
exists(string method_name | method_name in ["get_data", "get_json"] |
352352
// Method access
353353
nodeFrom = request().getAUse() and
354-
nodeTo = request().getMember(method_name).getAnImmediateUse()
354+
nodeTo.(DataFlow::AttrRead).getObject() = nodeFrom and
355+
nodeTo.(DataFlow::AttrRead).getAttributeName() = method_name
355356
or
356357
// Method call
357358
nodeFrom = request().getMember(method_name).getAUse() and

0 commit comments

Comments
 (0)