Merge pull request #8601 from zbazztian/recognize-flask-named-body-param

Python: Flask: Identify body contents passed via named response parameter in invocations of Response constructor
This commit is contained in:
Rasmus Wriedt Larsen
2022-04-01 14:19:28 +02:00
committed by GitHub
3 changed files with 17 additions and 5 deletions

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Improved modeling of Flask `Response` objects, so passing a response body with the keyword argument `response` is now recognized.

View File

@@ -122,7 +122,9 @@ module Flask {
private class ClassInstantiation extends InstanceSource, DataFlow::CallCfgNode {
ClassInstantiation() { this = classRef().getACall() }
override DataFlow::Node getBody() { result = this.getArg(0) }
override DataFlow::Node getBody() {
result in [this.getArg(0), this.getArgByName("response")]
}
override string getMimetypeDefault() { result = "text/html" }