hashview / hashview-old

A web front-end for password cracking and analytics
http://www.hashview.io
GNU General Public License v3.0
622 stars 133 forks source link

[v0.7.4-beta] Fix race condition #444

Closed I-Iugo closed 6 years ago

I-Iugo commented 6 years ago

Sequel already handles primary key incrementation, in addtion this line is not threadsafe. With this line, it's possible to create several users with identical ids at the same time.

Words from @jeremyevans :arrow_down:

The users table still seems to use a single primary key, not a composite primary key. I would delete the entire line as it is dangerous. If you run anything more than a single thread, single process application, it has a race condition that will cause it to fail.

ccammilleri commented 6 years ago

PR accepted, thanks @HugoPouliquen