Skip to content

Commit 2cb5ec5

Browse files
LefsFlareunknwon
LefsFlare
authored andcommitted
Prevented user enumeration of valid users through HTTP status codes of login (#3639) (#3654)
1 parent 2bec8a4 commit 2cb5ec5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

routers/user/auth.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,10 @@ func ForgotPasswdPost(ctx *context.Context) {
341341
u, err := models.GetUserByEmail(email)
342342
if err != nil {
343343
if models.IsErrUserNotExist(err) {
344-
ctx.Data["Err_Email"] = true
345-
ctx.RenderWithErr(ctx.Tr("auth.email_not_associate"), FORGOT_PASSWORD, nil)
344+
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
345+
ctx.Data["IsResetSent"] = true
346+
ctx.HTML(200, FORGOT_PASSWORD)
347+
return
346348
} else {
347349
ctx.Handle(500, "user.ResetPasswd(check existence)", err)
348350
}

0 commit comments

Comments
 (0)