Skip to content

Put detailed error message for auth command#6773

Closed
hwware wants to merge 2 commits intoredis:unstablefrom
hwware:autherrfix
Closed

Put detailed error message for auth command#6773
hwware wants to merge 2 commits intoredis:unstablefrom
hwware:autherrfix

Conversation

@hwware
Copy link
Contributor

@hwware hwware commented Jan 13, 2020

Put detailed error message for auth command for the following three error scenarios:
Disabled User:
acl setuser foo
OK
127.0.0.1:6379> auth foo 11
(error) DISABLEDUSER The user name specified was disabled

Wrong Password:
127.0.0.1:6379> ACL SETUSER alice on >p1pp0 ~cached:* +get
OK
127.0.0.1:6379> auth alice 333
(error) WRONGPASS The password specified for auth is not correct

Wrong User:
127.0.0.1:6379> auth ee 555
(error) WRONGUSER The user name specified for auth does not exist

passed make test:
189 seconds - integration/replication
223 seconds - integration/replication-psync

\o/ All tests passed without errors!

Cleanup: may take some time... OK

@hwware hwware changed the title put detailed error message for auth command Put detailed error message for auth command Jan 13, 2020
@laixintao
Copy link

Does this potentially reduced the difficulty to guess username out?

@hwware
Copy link
Contributor Author

hwware commented Jan 13, 2020

Hi @laixintao, thanks for your comment, In my opinion I don’t think so, since it only indicates the user doesn’t exist, while did not give any clue about the user name pattern. In the old way for the above three scenario, it only indicates wrong username password pair, which doesn’t give end user any clue why cannot authenticate with this user, that’s the purpose of this PR

@madolson
Copy link
Contributor

That's not technically true, it allows you to brute force what the usernames are. Although I agree they are less secretive than the passwords, I don't think we should be giving detailed error messages. Unless someone else finds a compelling reason for this, I don't think this should be accepted.

@oranagra
Copy link
Member

i agree this is undesirable.
any user system i know of, is responding with a generic "unknown user or wrong password".

@hwware i'm closing this one, but please keep up the good work.

@oranagra oranagra closed this Jul 29, 2020
@hwware
Copy link
Contributor Author

hwware commented Jul 29, 2020

Hi @madolson @oranagra ,thank you very much for the comments and suggestions :) But for disabled user case, should we show this message separately? I remember before I saw other software shows user disabled separately from wrong username and password.

@oranagra
Copy link
Member

@hwware do you remember which software was it?
@yossigo what do you think? should an AUTH attempt for a disabled user show different error message or generic one (one that returns for unknown username or password)?

@yossigo
Copy link
Collaborator

yossigo commented Jul 29, 2020

Common sense says don't provide additional information, i.e. if the user does not exist, is disabled, or just wrong password. This can be logged though.

@hwware
Copy link
Contributor Author

hwware commented Jul 29, 2020

Hi @oranagra , I forgot which exactly I saw before, but I think there is not only one cases, such as: https://openvpn.net/vpn-server-resources/troubleshooting-authentication-related-problems/. I think what @yossigo suggested also make sense, but if we change the error message accordingly to "user/pass combination is not correct, or user is suspended"make this better,how do you think? @oranagra @yossigo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants