mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* Improvements of the `aiohttp` models including heuristic sources and new path manipulation and SSRF sinks.
|
||||
* Improvements of the `aiohttp` models including remote-flow-sources from type annotations, new path manipulation, and SSRF sinks.
|
||||
|
||||
@@ -477,19 +477,15 @@ module AiohttpWebModel {
|
||||
DataFlow::ParameterNode, RemoteFlowSource::Range
|
||||
{
|
||||
AiohttpHeuristicRequestHandlerRequestParam() {
|
||||
exists(FunctionExpr fe, int i |
|
||||
// the API::Node is the annotation (type hint), we need to get the annotated parameter
|
||||
fe.getArgs().getAnnotation(i) =
|
||||
API::moduleImport("aiohttp")
|
||||
.getMember("web")
|
||||
.getMember("Request")
|
||||
.getAValueReachableFromSource()
|
||||
.asExpr() and
|
||||
fe.getInnerScope().getArg(i) = this.getParameter()
|
||||
)
|
||||
this.getParameter().getAnnotation() =
|
||||
API::moduleImport("aiohttp")
|
||||
.getMember("web")
|
||||
.getMember("Request")
|
||||
.getAValueReachableFromSource()
|
||||
.asExpr()
|
||||
}
|
||||
|
||||
override string getSourceType() { result = "aiohttp web request parameter" }
|
||||
override string getSourceType() { result = "aiohttp.web.Request from type-annotation" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user