Skip to content

Commit 32e2949

Browse files
authored
Merge pull request #734 from cokeBeer/main
fix #9097
2 parents 211580e + 7f21c0c commit 32e2949

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,39 @@ private import semmle.go.security.SafeUrlFlowCustomizations
1212
* from the [Beego](https://github.com/beego/beego) package.
1313
*/
1414
module Beego {
15-
/** Gets the module path `github.com/astaxie/beego` or `github.com/beego/beego`. */
16-
string modulePath() { result = ["github.com/astaxie/beego", "github.com/beego/beego"] }
15+
/** Gets the v1 module path `github.com/astaxie/beego` or `github.com/beego/beego`. */
16+
string v1modulePath() { result = ["github.com/astaxie/beego", "github.com/beego/beego"] }
17+
18+
/** Gets the v2 module path `github.com/beego/beego/v2` */
19+
string v2modulePath() { result = "github.com/beego/beego/v2" }
1720

1821
/** Gets the path for the root package of beego. */
19-
string packagePath() { result = package(modulePath(), "") }
22+
string packagePath() {
23+
result = package(v1modulePath(), "")
24+
or
25+
result = package(v2modulePath(), "server/web")
26+
}
2027

2128
/** Gets the path for the context package of beego. */
22-
string contextPackagePath() { result = package(modulePath(), "context") }
29+
string contextPackagePath() {
30+
result = package(v1modulePath(), "context")
31+
or
32+
result = package(v2modulePath(), "server/web/context")
33+
}
2334

2435
/** Gets the path for the logs package of beego. */
25-
string logsPackagePath() { result = package(modulePath(), "logs") }
36+
string logsPackagePath() {
37+
result = package(v1modulePath(), "logs")
38+
or
39+
result = package(v2modulePath(), "core/logs")
40+
}
2641

2742
/** Gets the path for the utils package of beego. */
28-
string utilsPackagePath() { result = package(modulePath(), "utils") }
43+
string utilsPackagePath() {
44+
result = package(v1modulePath(), "utils")
45+
or
46+
result = package(v2modulePath(), "core/utils")
47+
}
2948

3049
/**
3150
* `BeegoInput` sources of untrusted data.

0 commit comments

Comments
 (0)