Skip to content

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

Open
luisdlopera wants to merge 2 commits into
mainfrom
sentinel-fix-timing-attack-7225344166529140090
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix user enumeration timing attack#47
luisdlopera wants to merge 2 commits into
mainfrom
sentinel-fix-timing-attack-7225344166529140090

Conversation

@luisdlopera
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: A timing attack existed in the login.use-case.ts because bcryptjs.compare was given an invalid hash format when an unknown email was provided. This caused bcryptjs.compare to fail instantly instead of doing the work, creating a noticeable time difference between existing and non-existing users.
🎯 Impact: Attackers could enumerate user emails and figure out who has an account in the system by measuring the response time.
πŸ”§ Fix: Replaced the invalid hash string ($2a$12$dummyhash...) with a precomputed valid bcrypt hash string ($2b$12$...) so the computation takes the expected amount of time.
βœ… Verification: Ran the backend test suite successfully (cd back && pnpm test) and validated linting passed.
πŸ““ Journaled learning in .jules/sentinel.md


PR created automatically by Jules for task 7225344166529140090 started by @luisdlopera

Replaced an invalid dummy hash with a valid bcrypt hash to simulate accurate response times when a user is not found, thereby mitigating user enumeration via timing attack.
@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.

Wrapped `AuthPageContent` (which uses `useSearchParams()`) in a `<Suspense>` boundary to prevent the build error where Next.js requires components accessing dynamic client-side methods during pre-rendering to be suspended.
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