mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-13 18:44:14 +08:00
fix: Fixed login CAPTCHA bypass vulnerability (#11185)
This commit is contained in:
parent
781155b029
commit
bf4d91b68b
1 changed files with 3 additions and 4 deletions
|
|
@ -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 ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue