470
you are viewing a single comment's thread
view the rest of the comments
[-] TheYojimbo@lemmy.world 5 points 4 days ago

Not exactly. It should check for the username and password separately. First check if the user exists, then check if the salted passwords match.

[-] Pika@sh.itjust.works 3 points 4 days ago* (last edited 4 days ago)

Generally speaking, unless you're using OAuth for an authentication, you would check your username and your password at the same time. It's just you wouldn't respond if either existed or not. You would just say invalid username and password combination.

What gets really complicated is the hybrid SSO integrations where they use a username and then if the account has SSO enabled it then redirects you to the sign-in page, Otherwise, it brings you to a password field.

Realistically what these sites should do to prevent that vulnerability would be to make it so you have to click a dedicated sign in with single sign on button. But not everyone does that type of flow.

Granted, this also doesn't include sites that convert your user account into a user ID. And then for your password's table, only give a user ID. Those would require two queries or a join, regardless, because it's two separate data places. One to get the user Id and one to get the passwords

[-] TheYojimbo@lemmy.world 1 points 4 days ago

Yeah that's what I do, get user id from email then check password

this post was submitted on 10 Apr 2026
470 points (90.8% liked)

Programmer Humor

30937 readers
466 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS