Skip to content

Commit

Permalink
API 鉴权漏洞修复
Browse files Browse the repository at this point in the history
  • Loading branch information
yisier committed Dec 30, 2022
1 parent ae2010c commit ab81f5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

## 更新日志

- 2022-12-30 v0.26.14
***修复***:API 鉴权漏洞修复


- 2022-12-19
***修复***:某些场景下丢包导致服务端意外退出
***优化***:新增隧道时,不指定服务端口时,将自动生成端口号
Expand Down
2 changes: 1 addition & 1 deletion lib/version/version.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions web/controllers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ab81f5b

Please sign in to comment.