Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix user enumeration timing attack in login#56

Open
luisdlopera wants to merge 1 commit into
mainfrom
sentinel/fix-login-timing-attack-15165739727171900646
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix user enumeration timing attack in login#56
luisdlopera wants to merge 1 commit into
mainfrom
sentinel/fix-login-timing-attack-15165739727171900646

Conversation

@luisdlopera
Copy link
Copy Markdown
Owner

🚨 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. bcryptjs rejects 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.md journal.
βœ… Verification: Verified by checking that bcryptjs.compare executes 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

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`.
@google-labs-jules
Copy link
Copy Markdown

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant