The vulnerability lies in LiteLLM's API key management system, where multiple endpoints for creating and updating keys failed to properly authorize user-provided route permissions. The core of the issue is that the allowed_routes and allowed_passthrough_routes parameters were accepted and applied without verifying that the user making the request (an internal_user) was permitted to grant such routes. This allowed any authenticated user to create or modify an API key to include admin-only routes, effectively escalating their privileges to that of a proxy_admin.
The patches address this by introducing and consistently applying new validation functions (_check_allowed_routes_caller_permission and _check_passthrough_routes_caller_permission) across all key management endpoints: generate_key_fn, update_key_fn, regenerate_key_fn, and generate_service_account_key_fn. These checks ensure that only users with the proxy_admin role can specify custom routes, closing the privilege escalation pathway.