mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-06 08:00:22 +00:00
fix: Fixed login CAPTCHA bypass vulnerability (#11185)
This commit is contained in:
@@ -10,13 +10,12 @@ import (
|
||||
var store = base64Captcha.DefaultMemStore
|
||||
|
||||
func VerifyCode(codeID string, code string) string {
|
||||
if codeID == "" {
|
||||
return "ErrCaptchaCode"
|
||||
}
|
||||
vv := store.Get(codeID, true)
|
||||
vv = strings.TrimSpace(vv)
|
||||
code = strings.TrimSpace(code)
|
||||
|
||||
if codeID == "" || code == "" {
|
||||
return "ErrCaptchaCode"
|
||||
}
|
||||
if strings.EqualFold(vv, code) {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user