Group
  • Security

    Rate limit my login and signup endpoints

    Adds per-IP and per-account throttling with clear responses so credential stuffing and brute force stall out.

    • Improve quality
    • Intermediate
    • General

Free Prompt

Add rate limiting specifically to my authentication endpoints: login, signup, password reset, and any magic link or verification code request. Implement two layers: a per-IP limit (generous enough for shared networks, strict enough to slow scripted attacks) and a per-account limit on failed login attempts (for example, 5 failures triggers a 15-minute lockout for that account). Apply separate, stricter limits to password reset and code request endpoints since those send email and can be abused to spam users. Return a clear 429 response with a retry-after hint, and make the error message identical whether the account exists or not. Use the rate limiting approach that fits my stack (middleware for my framework, or a store backed by my existing database or Redis if present). Do not lock accounts permanently. Do not rate limit so aggressively that a user who typos their password a few times gets blocked for hours. Show me the limits you set for each endpoint and the reasoning. Give me a verification script or curl loop that hammers the login endpoint and shows the 429 kicking in at the right threshold.

What This Does / How This Helps

Puts brakes on your auth endpoints with per-IP and per-account limits, so password guessing and credential stuffing run into a wall instead of walking through thousands of attempts. An unthrottled login form is an open invitation. Leaked password lists get replayed against your app automatically, and without limits the attacker gets unlimited tries at full speed. The per-account lockout matters too: it stops targeted attacks on one specific user even when the attacker rotates IPs. You also get stricter limits on reset and code endpoints, which without them become a free way to spam your users' inboxes from your own domain.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts