leaderboardsgg / leaderboard-backend

The backend for Leaderboards.gg. Also holds public-facing APIs.
https://info.leaderboards.gg
GNU General Public License v3.0
12 stars 16 forks source link

Feature Request: Salted Passwords #174

Closed TheTedder closed 1 year ago

TheTedder commented 1 year ago

Currently, user passwords are simply hashed and then stored in the db I'm pretty sure. For security, they should be salted first, and the salt needs to be stored in the database.

Affected Functionality

When a user creates an account, a salting step needs to take place.

When a year tries to log in, the salt needs to be used to check against the existing salted and hashed password.

When a user resets their password, a new salt needs to be generated as well.

The User table will need a new row that contains just the salt. This is generally the same format and length as the hashed password.

Dalet commented 1 year ago

Passwords are already salted.

https://github.com/leaderboardsgg/leaderboard-backend/blob/48e31ccfb865b6f8e3f02c1fdb3d2a61b7de8156/LeaderboardBackend/Services/Impl/UserService.cs#L39

https://github.com/BcryptNet/bcrypt.net/blob/bcd7f45504380ecc3d0c2cd0c0d6e4845c8ef525/src/BCrypt.Net/BCrypt.cs#L534