From ab81f5b68ea896c1cde76b6ae04dee11be9d477a Mon Sep 17 00:00:00 2001 From: yisier <1340976576@qq.com> Date: Fri, 30 Dec 2022 12:24:48 +0800 Subject: [PATCH] =?UTF-8?q?API=20=E9=89=B4=E6=9D=83=E6=BC=8F=E6=B4=9E?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ lib/version/version.go | 2 +- web/controllers/base.go | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 589e032..c8ead20 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ ## 更新日志 +- 2022-12-30 v0.26.14 + ***修复***:API 鉴权漏洞修复 + + - 2022-12-19 ***修复***:某些场景下丢包导致服务端意外退出 ***优化***:新增隧道时,不指定服务端口时,将自动生成端口号 diff --git a/lib/version/version.go b/lib/version/version.go index ec37001..93a8bf0 100644 --- a/lib/version/version.go +++ b/lib/version/version.go @@ -1,6 +1,6 @@ package version -const VERSION = "0.26.13" +const VERSION = "0.26.14" // Compulsory minimum version, Minimum downward compatibility to this version func GetVersion() string { diff --git a/web/controllers/base.go b/web/controllers/base.go index 95da9b9..00b4257 100755 --- a/web/controllers/base.go +++ b/web/controllers/base.go @@ -32,6 +32,9 @@ func (s *BaseController) Prepare() { md5Key := s.getEscapeString("auth_key") timestamp := s.GetIntNoErr("timestamp") configKey := beego.AppConfig.String("auth_key") + if configKey == "" { + configKey = crypt.GetRandomString(64) + } timeNowUnix := time.Now().Unix() if !(md5Key != "" && (math.Abs(float64(timeNowUnix-int64(timestamp))) <= 20) && (crypt.Md5(configKey+strconv.Itoa(timestamp)) == md5Key)) { if s.GetSession("auth") != true {