Summary
SOGo's web login does not limit failed TOTP verification attempts or apply its failed-login counter to them. An attacker who already has a victim's password may repeatedly guess the second-factor code, potentially bypassing two-factor authentication.
Affected context
The issue occurs in SOGo's web login TOTP verification flow at /SOGo/connect. It becomes risky when an attacker has a victim's password and can submit repeated verification requests: failed TOTP attempts do not increment the failed-login counter, and SOGoMaximumFailedLoginCount does not apply to them.
Exploit preconditions
- Attack surface: SOGo's web login endpoint,
/SOGo/connect - Required access: The victim's password, plus network access to submit login requests
- Trigger point: TOTP verification after password authentication
- Why exploitation is possible: Failed TOTP guesses are not rate-limited or counted toward the login lockout, allowing repeated attempts across code windows
Why this happens
The TOTP verification path does not enforce an effective limit on failed second-factor attempts. This maps to CWE-307: Improper Restriction of Excessive Authentication Attempts: repeated guesses can be made without a counter or lockout governing that authentication step.
Potential impact
- An attacker with a victim's password may guess a valid TOTP code and bypass the second factor.
- A successful bypass could allow unauthorized access to the victim's SOGo account.
- Repeated automated requests could increase the risk of account compromise across successive code windows.
General mitigation guidance
Mitigations generally focus on applying consistent, effective controls to every authentication factor.
Common defensive patterns include:
- Rate-limit failed TOTP verification attempts, independently of password-login counters.
- Apply progressive delays or temporary lockouts after repeated failures, with safeguards against denial-of-service abuse.
- Use a shared, appropriately scoped attempt counter across relevant login paths and code windows.
- Monitor and restrict automated request rates at the application or gateway layer.
- Keep authentication services and accounts protected by least-privilege access and strong credential-handling practices.
How teams detect issues like this
Detection can focus on repeated failed second-factor attempts and gaps in enforcement:
- Review authentication code to verify that failed TOTP checks increment counters and invoke rate limits.
- Use static analysis or code review to identify verification paths that bypass shared throttling or lockout logic.
- Monitor logs for high-volume failed TOTP requests, repeated attempts against one account, or unusual request rates to
/SOGo/connect. - Enforce policies requiring rate limits for every authentication factor and test those controls in security reviews.

