Remix.run Logo
reverendsteveii 4 days ago

At my old job I was able to use a timing attack for remote username enumeration. Our login process was

1) get username and password from user

2) check if username exists and if not, return error

3) if username exists, look up hashed password from db

4) hash potential password

5) compare actual and potential password. if same, generate token and return. else, return error

As you can imagine, we live in a universe with physical laws so steps 3-5 took time. That meant that you could blast login requests with any username and a known-bad password and compare the times it took to return the bad login error. If it was relatively quick, the username was bad. If it took longer than average, the username was good and the password was bad. Combine this with the freely available lists of common usernames and common passwords and one could start with nothing but the address of the login page and walk away with valid cred pairs. We ended up doing ip-based lockout after 10 failed login attempts and adding a random delay of 100-400ms before erroring out on a bad username.