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]: Editting a key in the UI clears its user_id via /key/update (vuln?) #8394

Open
xmcp opened this issue Feb 8, 2025 · 1 comment
Open
Labels
bug Something isn't working mlops user request

Comments

@xmcp
Copy link

xmcp commented Feb 8, 2025

What happened?

Step to reproduce:

  • Log in as an internal user
  • Create a key via "Virtual Keys" -> "+ Create New Key"
  • Click on the edit button to bring up the modal, and then click on "Edit Key" to save
  • Refresh the page
  • Observe that the key is not shown in the "Virtual Keys" table anymore
  • The user can still make requests with this key, and the spend won't be linked to that user anymore

After carelessly inspecting the code, the problem might be that when /key/update is called without the user_id field, it will be reset to null in prepare_key_update_data.

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

Relevant log output

N/A

Are you a ML Ops Team?

Yes

What LiteLLM version are you on ?

v1.60.2

Twitter / LinkedIn details

No response

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

xmcp commented Feb 8, 2025

Wait I found that there is no need to even call /key/update. The /key/generate already sets user_id to null. Is this the expected behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mlops user request
Projects
None yet
Development

No branches or pull requests

1 participant