hashview / hashview-old

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

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

Closed I-Iugo closed 5 years ago

I-Iugo commented 5 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 5 years ago

PR accepted, thanks @HugoPouliquen