Skip to content

Implement Rate Limiting on Authentication Endpoints #2

@Akash504-ai

Description

@Akash504-ai

Description

Currently, authentication endpoints such as login, signup, password reset, and security answer verification do not have any rate limiting applied.

This exposes the application to potential abuse including:

  • Brute-force login attempts
  • Credential stuffing attacks
  • Security question abuse
  • Password reset token spamming

To improve security and protect user accounts, rate limiting should be implemented on all authentication-related routes.


Proposed Solution

  • Integrate a rate-limiting middleware (e.g., express-rate-limit)
  • Apply stricter limits on:
    • /api/auth/login
    • /api/auth/signup
    • /api/auth/verify-security-answers
    • /api/auth/reset-password
  • Configure:
    • Request limit per IP
    • Time window (e.g., 5–10 minutes)
  • Return proper HTTP 429 response when limit exceeded
  • Optionally log repeated abuse attempts

Acceptance Criteria

  • Rate limiting middleware implemented
  • Authentication endpoints protected
  • Proper 429 error response returned
  • Limits configurable via environment variables
  • No impact on normal user experience

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions