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

[Bug]: /user/list shows everyone's password #8422

Open
xmcp opened this issue Feb 9, 2025 · 2 comments
Open

[Bug]: /user/list shows everyone's password #8422

xmcp opened this issue Feb 9, 2025 · 2 comments
Labels

Comments

@xmcp
Copy link

xmcp commented Feb 9, 2025

What happened?

Any internal_user_viewer user can GET /user/list, which returns the password field for all users including admins.

Although this field may be hashed by SHA256, an attacker can directly use this to log into the UI, as implemented in login.

This is definitely a vulnerability but I will just post it here since it is too trivial for anyone to find.

Other endpoints such as /user/info also return the password field, so we'd better fix them as well.

Relevant log output

N/A

Are you a ML Ops Team?

Yes

What LiteLLM version are you on ?

main

Twitter / LinkedIn details

No response

@xmcp xmcp added the bug Something isn't working label Feb 9, 2025
@chrisranderson
Copy link

chrisranderson commented Feb 10, 2025

In which version was this introduced?

Any internal_user_viewer user can GET /user/list

FWIW, the docstring for get_users says "Currently - admin-only endpoint." I didn't see where that's enforced from a quick look.

@xmcp
Copy link
Author

xmcp commented Feb 11, 2025

@chrisranderson Seems that there are lots of checking in route_checks.py but unfornately checks for /user/list are missing.

FYI, I am using nginx to workaround this vulnerability by enforcing additional route checking:

upstream litellm {
    server ...;
}
map $auth_result $litellm_only_admin {
    admin litellm;
    default litellm/404;
}

server {
    # llm api routes
    location ~ ^(/v\d+)?/(chat/|images/|audio/|batches/|files/|completions$|embeddings$|models$) {
        proxy_pass http://litellm;
        proxy_buffering off;
    }
    
    # ui routes
    location ~ ^/(login|ui/.*|sso/get/ui_settings|team/list|user/info|global/spend/(logs|keys|models|provider)|global/activity(/model)?|(model|model_group)/info)$ {
        include includes/auth.conf;
        proxy_pass http://litellm;
    }
    
    # allow admin user to view all routes
    location / {
        include includes/auth.conf;
        proxy_pass http://$litellm_only_admin;
    }

    ...
}

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

3 participants