fix: Rate Limiting on Auth Endpoints #306
Conversation
|
@lowkeyprisha is attempting to deploy a commit to the anubhav12302387's projects Team on Vercel. A member of the Team first needs to authorize it. |
👋 Thanks for opening a PR, @lowkeyprisha!Your PR has entered the 🎯 EventOne GSSoC PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. EventOne × GSSoC Automated Pipeline |
✅ PR Format Check — PassedHi @lowkeyprisha! Your PR passed all automated checks and is now queued for mentor review. 🎉 ✅ Checks Passed
📋 EventOne PR Guidelines (click to expand)Title format — Conventional Commits: Always link an issue: Use a feature branch — never PR directly from Write your own description — AI-generated content = EventOne × GSSoC Pipeline — Stage 1 Automated Check |
This PR only modifies: Both pass the Backend Install & Lint check successfully ✅ |
|
Hey @lowkeyprisha! Saw your work on GSSoC 2026. We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal. We have well-scoped bug-fix issues open with clear reproduction steps. Your JavaScript background transfers directly. Karanjot, TermUI maintainer |
🔍 Problem
While going through the codebase in detail as part of my GSSoC '26 contribution, I found that the rate limiting implementation in
authRoutes.jshad the following issues:/signupwas usingauthRateLimiter(the login limiter) instead ofregistrationLimiter— meaning the stricter per-hour signup cap was never actually appliedregistrationLimiterhad awindowMsof only 1 minute instead of 1 hour, making it nearly ineffective against signup spamauthRateLimiterwas an unnecessary alias forauthLimiter— confirmed unused across the entire codebase via grep✅ Changes Made
backend/src/middleware/rateLimiters.jsregistrationLimiterwindow from60 * 1000(1 min) →60 * 60 * 1000(1 hour)skipSuccessfulRequests: truetoauthLimiterso legitimate logins don't get penalizedauthRateLimiteralias (confirmed zero usages in codebase)backend/src/routes/authRoutes.js/signupnow correctly usesregistrationLimiter/loginnow correctly usesauthLimiter🧪 Testing
Verified no other file in
backend/srcimportsauthRateLimiterusing:Only
authRoutes.jsandregistrationRoutes.jsimport fromrateLimiters.js— both unaffected. Manually tested login and signup endpoints — rate limiting triggers correctly after threshold.📎 Related Issue
Closes #209 — No Rate Limiting on Auth Endpoints — Vulnerable to Brute Force Attacks