fix: prevent username enumeration via login timing attack#146
fix: prevent username enumeration via login timing attack#146rotarymars wants to merge 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes enhance authentication security by implementing timing-attack resistance in the login endpoint through constant-time bcrypt comparison and converting synchronous password hashing to asynchronous in the signup endpoint. Both modifications improve the security posture of the auth system. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the |
Replace malformed dummy hash (48 chars) with a properly generated bcrypt hash (60 chars) so timing-attack prevention works correctly. Also switch signup route from bcrypt.hashSync to async bcrypt.hash to avoid blocking the event loop (subsumes PR #147). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Description
Creating a safer login system.
This tries to make the return speed consistent regardless of whether the username exists or not.
Type of Change
Changes Made
Testing
npm run devnpm run build)npm run lint)Screenshots (if applicable)
Checklist
Related Issues
Summary by CodeRabbit
Bug Fixes