Skip to content

Commit 3fc598d

Browse files
committed
Convert EchoContextSource to MaD
1 parent 5b38d51 commit 3fc598d

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

go/ql/lib/ext/github.com.labstack.echo.model.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,19 @@ extensions:
55
data:
66
- ["github.com/labstack/echo", "Context", True, "Get", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
77
- ["github.com/labstack/echo", "Context", True, "Set", "", "", "Argument[1]", "Argument[receiver]", "taint", "manual"]
8+
9+
- addsTo:
10+
pack: codeql/go-all
11+
extensible: sourceModel
12+
data:
13+
- ["github.com/labstack/echo", "Context", True, "Param", "", "", "ReturnValue[0]", "remote", "manual"]
14+
- ["github.com/labstack/echo", "Context", True, "ParamValues", "", "", "ReturnValue[0]", "remote", "manual"]
15+
- ["github.com/labstack/echo", "Context", True, "QueryParam", "", "", "ReturnValue[0]", "remote", "manual"]
16+
- ["github.com/labstack/echo", "Context", True, "QueryParams", "", "", "ReturnValue[0]", "remote", "manual"]
17+
- ["github.com/labstack/echo", "Context", True, "QueryString", "", "", "ReturnValue[0]", "remote", "manual"]
18+
- ["github.com/labstack/echo", "Context", True, "FormValue", "", "", "ReturnValue[0]", "remote", "manual"]
19+
- ["github.com/labstack/echo", "Context", True, "FormParams", "", "", "ReturnValue[0]", "remote", "manual"]
20+
- ["github.com/labstack/echo", "Context", True, "FormFile", "", "", "ReturnValue[0]", "remote", "manual"]
21+
- ["github.com/labstack/echo", "Context", True, "MultipartForm", "", "", "ReturnValue[0]", "remote", "manual"]
22+
- ["github.com/labstack/echo", "Context", True, "Cookie", "", "", "ReturnValue[0]", "remote", "manual"]
23+
- ["github.com/labstack/echo", "Context", True, "Cookies", "", "", "ReturnValue[0]", "remote", "manual"]

go/ql/lib/semmle/go/frameworks/Echo.qll

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@ private module Echo {
99
/** Gets the package name `github.com/labstack/echo`. */
1010
private string packagePath() { result = package("github.com/labstack/echo", "") }
1111

12-
/**
13-
* Data from a `Context` interface method, considered as a source of remote flow.
14-
*/
15-
private class EchoContextSource extends RemoteFlowSource::Range {
16-
EchoContextSource() {
17-
exists(DataFlow::MethodCallNode call, string methodName |
18-
methodName =
19-
[
20-
"Param", "ParamValues", "QueryParam", "QueryParams", "QueryString", "FormValue",
21-
"FormParams", "FormFile", "MultipartForm", "Cookie", "Cookies"
22-
] and
23-
call.getTarget().hasQualifiedName(packagePath(), "Context", methodName) and
24-
this = call.getResult(0)
25-
)
26-
}
27-
}
28-
2912
/**
3013
* Data from a `Context` interface method that is not generally exploitable for open-redirect attacks.
3114
*/

0 commit comments

Comments
 (0)