-
Notifications
You must be signed in to change notification settings - Fork 103
OTP Attempt Limiting #277
Copy link
Copy link
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Implement a
max_attemptscheck (e.g., 5) for OTP recovery verification to prevent brute-force attacks.Context
OTP-based recovery is vulnerable to brute-force if not rate-limited. Implementing an attempt counter ensures that an attacker cannot guess the code before the session is locked.
Implementation Guidelines
Key Files:
src/server/services/otp.service.ts,src/server/db/schema.ts.email_verificationstable has anattemptscolumn (existing inschema.ts).attemptson every failure.attempts >= 5, mark the OTP as invalid or throw aTooManyRequestsError.Expectations
What done looks like: After 5 incorrect OTP entries, the user is blocked from further attempts for that verification session.
Discord for any question: codeze_us