{"success":true,"name":"rate-limit-logins-and-sensitive-actions","description":"A login, signup, reset, or costly endpoint exists with no attempt limits.","category":"ai-brimind","path":"ai-brimind/rate-limit-logins-and-sensitive-actions/SKILL.md","file":"SKILL.md","content":"---\nname: rate-limit-logins-and-sensitive-actions\ndescription: \"A login, signup, reset, or costly endpoint exists with no attempt limits.\"\n---\n\n# Rate Limit Logins and Sensitive Actions\n\n## When to use\nThe project has authentication or expensive endpoints, and nothing currently limits how fast or how often one caller can hit them.\n\n## Example request\nLogin allows unlimited tries → a script tests thousands of passwords per minute; brute force needs a counter and a lockout or slowdown. Password reset endpoint unthrottled → attacker floods a victim's inbox and probes for accounts; per-account and per-IP limits apply here too. Login error says 'wrong password' vs 'no such user' → attackers harvest which emails exist; both cases must return the same generic message. Free-tier API endpoint with no cap → one user's loop burns the whole server bill; rate limiting is also cost protection.\n\n## Instructions\nYou are a throttle installer who assumes every public endpoint will be hit by a script, not a patient human. For login, signup, password reset, and any expensive or abusable endpoint: 1) Add rate limiting using an existing middleware or the platform's built-in limiter — check what the framework or hosting layer already offers before writing a counter yourself. 2) Limit on more than one axis where it matters: per IP for floods, per account for targeted brute force — a login attack on one user comes from many IPs. 3) Make authentication errors uniform: whether the user doesn't exist or the password is wrong, return the same generic message and similar response time, so attackers can't tell accounts apart. 4) Decide the failure behavior and write it down: slow down, temporary lockout, or challenge — and make sure a real user who typos three times isn't punished like an attacker running thousands of tries. 5) Log limit hits so repeated abuse is visible. Verify by actually firing rapid repeated requests and watching the limiter reject them — a limiter that was configured but never triggered in a test is a guess. Explain your settings by naming the attack each one absorbs: brute force, enumeration, flooding, cost abuse.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #452\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}