π‘οΈ Sentinel: [HIGH] Fix bcrypt timing attack vulnerability in login flow#51
π‘οΈ Sentinel: [HIGH] Fix bcrypt timing attack vulnerability in login flow#51luisdlopera wants to merge 1 commit into
Conversation
π¨ Severity: HIGH π‘ Vulnerability: When authenticating, non-existent users were validated against an invalid bcrypt string (`$2a$12$dummyhash...`). Because `bcryptjs.compare()` fails fast on invalid hash formats (0ms), it bypassed the intended timing attack mitigation, allowing an attacker to determine if an email exists by measuring the response time difference between existing users (~100ms) and non-existing users (0ms). π― Impact: Attackers could enumerate registered users via a timing attack on the login endpoint. π§ Fix: Used a pre-computed valid bcrypt hash with the same work factor (10) as real hashes (`$2b$10$...`) for dummy comparisons. Also fixed a `useSearchParams` Suspense boundary error in the frontend. β Verification: `pnpm build`, `pnpm test`, and `pnpm lint` pass successfully locally.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Fixes a high-severity timing attack vulnerability in
login.use-case.ts.useSearchParams()missing a<Suspense>boundary in/auth/page.tsx..jules/sentinel.mdwith findings and lessons learned.PR created automatically by Jules for task 17326812143300663532 started by @luisdlopera