π‘οΈ Sentinel: [CRITICAL] Fix user enumeration timing attack in login#56
π‘οΈ Sentinel: [CRITICAL] Fix user enumeration timing attack in login#56luisdlopera wants to merge 1 commit into
Conversation
Replaced the malformed dummy bcrypt hash in the login use-case with a valid pre-computed hash of cost 10. The malformed hash was causing `bcryptjs.compare` to fail instantaneously, defeating the timing attack protection and allowing for user enumeration. Added journal entry to `.jules/sentinel.md`.
|
π 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. |
π¨ Severity: CRITICAL
π‘ Vulnerability: User Enumeration via Timing Attack. The dummy bcrypt hash used to normalize response times when a user is not found was malformed.
bcryptjsrejects improperly formatted strings almost instantly without performing the expensive hashing computation. This resulted in the API responding significantly faster for non-existent users than for valid users.π― Impact: Attackers could determine which email addresses exist in the system by measuring the response time of the login endpoint.
π§ Fix: Replaced the malformed hash with a valid, pre-computed dummy hash using the exact same cost factor (10) as legitimate password hashes. This ensures that the response time is consistent regardless of whether the user exists. Also added an entry to the
.jules/sentinel.mdjournal.β Verification: Verified by checking that
bcryptjs.compareexecutes the CPU-intensive work and response times are balanced. Also ran tests and linter successfully.PR created automatically by Jules for task 15165739727171900646 started by @luisdlopera