Skip to content

Commit 69efddb

Browse files
Alvaro MuñozRasmusWL
andauthored
Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 7a71755 commit 69efddb

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
category: minorAnalysis
33
---
4-
* Improvements of the `aiohttp` models including heuristic sources and new path manipulation and SSRF sinks.
4+
* Improvements of the `aiohttp` models including remote-flow-sources from type annotations, new path manipulation, and SSRF sinks.

python/ql/lib/semmle/python/frameworks/Aiohttp.qll

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -477,19 +477,15 @@ module AiohttpWebModel {
477477
DataFlow::ParameterNode, RemoteFlowSource::Range
478478
{
479479
AiohttpHeuristicRequestHandlerRequestParam() {
480-
exists(FunctionExpr fe, int i |
481-
// the API::Node is the annotation (type hint), we need to get the annotated parameter
482-
fe.getArgs().getAnnotation(i) =
483-
API::moduleImport("aiohttp")
484-
.getMember("web")
485-
.getMember("Request")
486-
.getAValueReachableFromSource()
487-
.asExpr() and
488-
fe.getInnerScope().getArg(i) = this.getParameter()
489-
)
480+
this.getParameter().getAnnotation() =
481+
API::moduleImport("aiohttp")
482+
.getMember("web")
483+
.getMember("Request")
484+
.getAValueReachableFromSource()
485+
.asExpr()
490486
}
491487

492-
override string getSourceType() { result = "aiohttp web request parameter" }
488+
override string getSourceType() { result = "aiohttp.web.Request from type-annotation" }
493489
}
494490

495491
/**

0 commit comments

Comments
 (0)