2 ms·
The elephant in the room is what you return when you SELECT. My POV is you should be able to verify user sign-in with something like "SELECT COUNT(*) FROM user
by nly 11y ago
The elephant in the room is what you return when you SELECT.
My POV is you should be able to verify user sign-in with something like "SELECT COUNT(*) FROM users WHERE email = 'maaku@hellokitty.com' AND password='hunter2';", which has the added bonus of not informing the client whether the query failed because the user didn't exist, or because the password was wrong. Imho, all queries for the column content should simply fail.
- DCoder 11y agoNote that this approach can expose the user entered password in application debug logs, MySQL's slow queries log (if you're not using bind variables), etc.
- dthakur 11y agoIf there are other ways to confirm whether a user exists or not (signup email check for example) -- I would add that the 'bonus' of not informing of the correct error provides minimal security gain and hurts usability.
- nly 11y ago> If there are other ways to confirm whether a user exists or not (signup email check for example) -- This would be a bug. There should be no way for someone with my e-mail address to determine if I use any particular service.