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

Throw an error on invalid credentials #2479

Open
meisterT opened this issue Apr 18, 2024 · 6 comments
Open

Throw an error on invalid credentials #2479

meisterT opened this issue Apr 18, 2024 · 6 comments
Labels

Comments

@meisterT
Copy link
Member

When downloading data via the API, we determine the data to expose based on the user role.

Currently, if you pass incorrect credentials, we just fall back to public data. It would be better to fail hard to clearly indicate that credentials should be corrected.

@vmcj
Copy link
Member

vmcj commented Apr 21, 2024

When downloading data via the API, we determine the data to expose based on the user role.

Currently, if you pass incorrect credentials, we just fall back to public data. It would be better to fail hard to clearly indicate that credentials should be corrected.

I'm not sure if I agree, in this specific case we could have tested against the /account endpoint and see if we had the needed access. It feels like a security flaw to acknowledge when people have the wrong credentials as depending on implementation this would open up for an user enumeration attack.

@eldering eldering added the API label Apr 24, 2024
@eldering
Copy link
Member

There is no enumeration attack: if you provide invalid an user/password combination then we can return a 401 error code. That only means that that user/password combination is invalid, not that the user exists.

I think I agree that returning a 401 is better than just falling back to public data.

@nickygerritsen
Copy link
Member

When do you get this? If I use HTTPie to get an API endpoint with an invalid user, I get a HTTP/1.1 401 Unauthorized.

@vmcj
Copy link
Member

vmcj commented May 21, 2024

When do you get this? If I use HTTPie to get an API endpoint with an invalid user, I get a HTTP/1.1 401 Unauthorized.

I think the case was for a situation where you don't authenticate at all and receive public data. @tuupke encountered this with Ansible for EUC IIRC.

@nickygerritsen
Copy link
Member

But there is nothing we can do there, is there? You are allowed to get public data…

@meisterT
Copy link
Member Author

@tuupke do you remember on which endpoint this happened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants