Summary
SOGo's password-recovery flow can allow unlimited guesses of secret-question answers without rate limiting or lockout. An unauthenticated attacker who obtains a valid recovery token may reset an account's password and take over accounts that do not have TOTP enabled.
Affected context
The issue affects SOGo password recovery when the passwordRecoveryCheck endpoint accepts repeated secret-question answer attempts without effective throttling or lockout. Risk is greatest for accounts that rely on secret questions and do not have TOTP enabled; successful verification can issue a recovery JWT that permits a password change.
Exploit preconditions
- Attack surface: The password-recovery flow, including the
passwordRecoveryCheckendpoint - Required access: No prior authentication is required; the attacker needs to target an account and submit recovery attempts
- Trigger point: Repeated guesses of the account's secret-question answer
- Why exploitation is possible: Attempts are not sufficiently rate-limited or locked out, allowing guesses until a valid recovery JWT is obtained
- Scope condition: Account takeover is possible when recovery succeeds and the account does not have TOTP enabled
Why this happens
The recovery endpoint permits excessive authentication attempts without an effective restriction, mapping to CWE-307: Improper Restriction of Excessive Authentication Attempts. The insecure pattern is accepting repeated guesses for a recovery factor without throttling, lockout, or another control that limits automated verification attempts.
Potential impact
- An attacker could obtain a valid recovery JWT after guessing a secret-question answer.
- An attacker may change the account password without knowing the existing password.
- An attacker could log in as the affected user and access that account's data or functions.
- Accounts without TOTP enabled may be at greater risk of full account takeover.
General mitigation guidance
Defensive patterns focus on making recovery attempts resistant to guessing and limiting the authority of recovery tokens:
- Apply per-account and broader rate limits, with progressive delays or temporary lockouts for repeated failures.
- Prefer recovery methods that do not depend on guessable knowledge-based answers.
- Require a second factor or equivalent verification for sensitive recovery actions where appropriate.
- Make recovery tokens short-lived, single-use, and scoped only to the intended password-reset action.
- Avoid exposing whether an account or recovery answer is valid, and monitor repeated failures.
- Protect recovery flows with controls proportionate to the impact of changing account credentials.
How teams detect issues like this
Review password-recovery handlers for missing or ineffective per-account throttling, lockout, and attempt tracking. Test whether repeated failed answers are accepted without increasing friction, and inspect token issuance and use for expiry, single-use enforcement, and narrow scope. Centralized policies can require rate limits and monitoring for authentication and recovery endpoints; logs can be reviewed for repeated failures followed by recovery-token issuance or password changes.

