Skip to content

Commit fc12537

Browse files
committed
Go: Add Macaron sources
1 parent 664dac6 commit fc12537

File tree

6 files changed

+92
-83
lines changed

6 files changed

+92
-83
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Added dataflow sources for the package `gopkg.in/macaron.v1`.

go/ql/lib/ext/gopkg.in.macaron.model.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["gopkg.in/macaron", "Context", True, "AllParams", "", "", "ReturnValue", "remote", "manual"]
7+
- ["gopkg.in/macaron", "Context", True, "GetCookie", "", "", "ReturnValue", "remote", "manual"]
8+
- ["gopkg.in/macaron", "Context", True, "GetSecureCookie", "", "", "ReturnValue[0]", "remote", "manual"]
9+
- ["gopkg.in/macaron", "Context", True, "GetSuperSecureCookie", "", "", "ReturnValue[0]", "remote", "manual"]
10+
- ["gopkg.in/macaron", "Context", True, "GetFile", "", "", "ReturnValue[0]", "remote", "manual"]
11+
- ["gopkg.in/macaron", "Context", True, "Params", "", "", "ReturnValue", "remote", "manual"]
12+
- ["gopkg.in/macaron", "Context", True, "ParamsEscape", "", "", "ReturnValue", "remote", "manual"]
13+
- ["gopkg.in/macaron", "Context", True, "Query", "", "", "ReturnValue", "remote", "manual"]
14+
- ["gopkg.in/macaron", "Context", True, "QueryEscape", "", "", "ReturnValue", "remote", "manual"]
15+
- ["gopkg.in/macaron", "Context", True, "QueryStrings", "", "", "ReturnValue", "remote", "manual"]
16+
- ["gopkg.in/macaron", "RequestBody", True, "Bytes", "", "", "ReturnValue[0]", "remote", "manual"]
17+
- ["gopkg.in/macaron", "RequestBody", True, "String", "", "", "ReturnValue[0]", "remote", "manual"]
218
- addsTo:
319
pack: codeql/go-all
420
extensible: summaryModel
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
| sources.go:10:6:10:20 | call to AllParams |
2+
| sources.go:11:6:11:22 | call to GetCookie |
3+
| sources.go:12:2:12:31 | ... = ...[0] |
4+
| sources.go:13:2:13:40 | ... = ...[0] |
5+
| sources.go:14:2:14:26 | ... = ...[0] |
6+
| sources.go:15:6:15:19 | call to Params |
7+
| sources.go:16:6:16:25 | call to ParamsEscape |
8+
| sources.go:17:6:17:18 | call to Query |
9+
| sources.go:18:6:18:24 | call to QueryEscape |
10+
| sources.go:19:6:19:25 | call to QueryStrings |
11+
| sources.go:20:2:20:20 | ... = ...[0] |
12+
| sources.go:21:2:21:21 | ... = ...[0] |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import go
2+
3+
select any(UntrustedFlowSource ufs)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
//go:generate depstubber -vendor gopkg.in/macaron.v1 Context,RequestBody
4+
5+
import (
6+
"gopkg.in/macaron.v1"
7+
)
8+
9+
func sources(ctx *macaron.Context, body *macaron.RequestBody) {
10+
_ = ctx.AllParams()
11+
_ = ctx.GetCookie("")
12+
_, _ = ctx.GetSecureCookie("")
13+
_, _ = ctx.GetSuperSecureCookie("", "")
14+
_, _, _ = ctx.GetFile("")
15+
_ = ctx.Params("")
16+
_ = ctx.ParamsEscape("")
17+
_ = ctx.Query("")
18+
_ = ctx.QueryEscape("")
19+
_ = ctx.QueryStrings("")
20+
_, _ = body.Bytes()
21+
_, _ = body.String()
22+
}

go/ql/test/library-tests/semmle/go/frameworks/Macaron/vendor/gopkg.in/macaron.v1/stub.go

Lines changed: 35 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)