Vulnerability Fixation
Non Time Bound and Reusable OTPs

Non-Time-Bound And Reuseable OTPs

OTPs are often seen as a way to enhance security, as they are typically valid for a short period and can only be used once. A critical vulnerability arises when OTPs are neither time-bound nor one-time usable, allowing them to be used multiple times and exposing the application to brute-force attacks.

To mitigate this, OTPs should always have strict expiration times and be invalidated immediately after use. Implementing rate limiting, retry restrictions, and server-side validation further ensures that attackers cannot reuse or guess OTPs through automated or brute-force attempts.

Vulnerability

  • Some applications fail to enforce OTP expiry or to invalidate OTPs after successful use.
  • As a result, OTPs may remain valid indefinitely or be reused multiple times, allowing attackers to perform repeated authentication attempts or replay attacks.
Impact

  • Account Compromise: Attackers can reuse intercepted or previously valid OTPs to gain unauthorized access.
  • Replay Attacks: Non-expiring OTPs can be reused after transmission, compromising authentication integrity.
  • Brute-Force Attacks: Without expiry or single-use enforcement, attackers can guess OTPs repeatedly.

Solution

  • Set Expiry Time: Limit OTP validity (e.g., 5–10 minutes) to prevent reuse after expiration.
  • Single-Use Enforcement: Invalidate OTPs immediately after successful authentication.
  • Rate Limiting & Lockout: Restrict OTP validation attempts (e.g., 3–5 tries per minute) and temporarily lock accounts after multiple failures.

Also Read :