News for hackers. Stuff that matters.
Re:Database leak exposes 3.3M Hello Kitty fans by dopamean on Tuesday December 22, 2015 @12:12PM (#10778892)
This sounds like such an obviously great idea that I don't know how I haven't heard it before. Can someone who understands how databases are built explain why this isn't an obviously great idea?
Re:Database leak exposes 3.3M Hello Kitty fans by bhauer on Tuesday December 22, 2015 @12:27PM (#10778990)
One thought is that it puts the computational load of verifying user-provided passwords in your database tier, rather than in your application tier, where it exists today. Let's say that right now, you have a 200ms computation necessary to verify a bcrypt-secured password. If you have that in your application tier, you can easily scale that horizontally with more CPUs if necessary. It may be a bit more difficult to scale CPU capacity in the database tier.

However, another approach would be extension of the database's client-server protocol and driver(s) such that the hash verification occurs within the application tier (as part of the driver). Or, moving further along that path, the field could be annotated in your ORM, exposing special set and verify methods. But at that point, you're very close to the current condition, where the hashing occurs within your web application framework.

Or hashing could be done on the client side.

Re:Database leak exposes 3.3M Hello Kitty fans by nly on Tuesday December 22, 2015 @12:47PM (#10779109)
> Or hashing could be done on the client side.

Only if you use a proper PAKE. A vanilla password hash is still a bearer token on the wire.

Re:Database leak exposes 3.3M Hello Kitty fans by nly on Tuesday December 22, 2015 @12:25PM (#10778983)
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 = '[email protected]' 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.

Re:Database leak exposes 3.3M Hello Kitty fans by DCoder on Tuesday December 22, 2015 @12:49PM (#10779128)
Note 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.
Re:Database leak exposes 3.3M Hello Kitty fans by nly on Tuesday December 22, 2015 @01:31PM (#10779400)
That's true currently of any HTTP-level logs
Re:Database leak exposes 3.3M Hello Kitty fans by DCoder on Tuesday December 22, 2015 @01:56PM (#10779547)
Yes, it is, but that doesn't excuse doing it here.
Re:Database leak exposes 3.3M Hello Kitty fans by dthakur on Tuesday December 22, 2015 @01:49PM (#10779504)
If 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.

Re:Database leak exposes 3.3M Hello Kitty fans by nly on Tuesday December 22, 2015 @07:26PM (#10781283)
> 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.