Skip to content

Commit 27c479a

Browse files
committed
Python: Limit RequestInputAccess to immediate uses
This fixes some spurious results that occurred when we considered _any_ use of `request.something` to be a source, even ones we had tracked into other functions. To prevent this, using `getAnImmediateUse` better captures the fact that we want the source to be just the actual attribute access.
1 parent 4c66071 commit 27c479a

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ private module FlaskModel {
312312

313313
RequestInputAccess() {
314314
// attributes
315-
this = flask::request().getMember(attr_name).getAUse() and
315+
this = flask::request().getMember(attr_name).getAnImmediateUse() and
316316
attr_name in [
317317
// str
318318
"path", "full_path", "base_url", "url", "access_control_request_method",

0 commit comments

Comments
 (0)