The vulnerability lies in the generation of password reset tokens. The system was using the lifetime intended for account activation codes (conf.Auth.ActivateCodeLives) instead of the one configured for password resets (conf.Auth.ResetPasswordCodeLives). This discrepancy created a security flaw where password reset tokens remained valid for a much longer period than specified by the administrator, increasing the window for potential misuse if a token was intercepted.
The root cause is in the userx.GenerateActivateCode function, which was used for both account activation and password resets but was hardcoded to use the activation code's lifetime. The email.SendResetPasswordMail function triggered this vulnerability by calling GenerateActivateCode to generate the token for password reset emails.
During exploitation, an attacker would use a reset token that should have expired according to RESET_PASSWORD_CODE_LIVES but is still valid due to the longer ACTIVATE_CODE_LIVES. The exploitation process would involve the auth.ResetPasswdPost and auth.verifyUserActiveCode functions, which handle the submission and verification of the reset token. Although these verification functions are not themselves vulnerable (they correctly validate the token based on its embedded lifetime), they are key components in the exploitation chain.