Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error message when login with wrong user #2630

Closed
mmartin24 opened this issue Oct 6, 2023 · 1 comment · Fixed by #2658
Closed

Misleading error message when login with wrong user #2630

mmartin24 opened this issue Oct 6, 2023 · 1 comment · Fixed by #2658
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@mmartin24
Copy link
Contributor

Issue

When performing login with an inexisting or wrong user, the error message always outputs as cause the password.
For example:

epinio login -u wrong-user https://epinio.192.168.16.3.omg.howdoi.website

🚢  Login to your Epinio cluster [https://epinio.192.168.16.3.omg.howdoi.website]
Password: 

⚠️  Certificate signed by unknown authority

|     KEY     |      VALUE      |
|-------------|-----------------|
| Issuer Name | CN=epinio-ca    |
| Common Name | epinio-ca       |
| Expiry      | 2024-January-04 |

Do you want to trust it (y/n): y

✔️  Trusting certificate for address https://epinio.192.168.16.3.omg.howdoi.website...

❌  error verifying credentials: error while connecting to the Epinio server: wrong password


Perhaps we could:

  • Change the output message to something that also points to username as a possible error cause like:
    error verifying credentials: error while connecting to the Epinio server: wrong username or password
  • Search if that user exists first and handle the error towards username error or password error accordingly

Test environment

Platform: k3s
Kubernetes Version: v1.25.4+k3s1
Epinio Server Version: v1.10.0-15-g47ee6f4e
Epinio Client Version: v1.10.0-15-g47ee6f4e

@mmartin24 mmartin24 added the kind/bug Something isn't working label Oct 6, 2023
@enrichman enrichman added this to the v1.11.0 milestone Oct 11, 2023
@andreas-kupries andreas-kupries self-assigned this Oct 16, 2023
@andreas-kupries
Copy link
Contributor

Search if that user exists first and handle the error towards username error or password error accordingly

That gives the attacker information, i.e. enabling separate search for a valid user before then having a go at the password.
Better to always claim wrong user or password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants