Summary A critical business logic vulnerability exists in the password reset mechanism of vikunja/api that allows password reset tokens to be reused indefinitely. Due to a failure to invalidate tokens upon use and a critical logic bug in the token cleanup cron job, reset tokens remain valid forever.
This allows an attacker who intercepts a single reset token (via logs, browser history, or phishing) to perform a complete, persistent account takeover at any point in the future, bypassing standard authentication controls.
Technical Analysis The vulnerability stems from two distinct logic errors in the pkg/user/ package that confirm the tokens are never removed.
Vulnerable Code: pkg/user/user_password_reset.go (Lines 36-94)
func ResetPassword(s *xorm.Session, reset *PasswordReset) (userID int64, err error) {
// ... [Validation and User Lookup] ...
// Hash the password
user.Password, err = HashPassword(reset.NewPassword)
if err != nil {
return
}
// FLAW: Deletes 'TokenEmailConfirm' instead of the current 'TokenPasswordReset'
err = removeTokens(s, user, TokenEmailConfirm)
if err != nil {
return
}
// ... [Update User Status and Return] ...
// The reset token is never removed and remains valid in the DB.
}
Vulnerable Code: pkg/user/token.go (Lines 125-151)
func RegisterTokenCleanupCron() {
// ...
err := cron.Schedule("0 * * * *", func() {
// ......
Exploitability
AV:NAC:LPR:NUI:NScope
S:UImpact
C:HI:HA:H9.8/CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H