Summary
LiteLLM versions prior to 1.83.14 contain an authorization flaw in the API key creation flow that allows an authenticated internal_user to mint keys with permissions beyond their role.
Because the allowed_routes field is not validated against the creator's own access rights, an internal_user can generate a key granting access to admin-only routes and then use that key to fully bypass role-based access controls.
Affected context
This vulnerability affects LiteLLM deployments that:
- Use role-based access control (RBAC) with roles such as internal_user and proxy_admin
- Allow authenticated internal_user accounts to create API keys
- Rely on the allowed_routes field on API keys to enforce per-key route access
The issue arises in environments where the API key creation endpoint accepts arbitrary allowed_routes values without verifying that each requested route is already permitted for the calling user's role.
Exploit preconditions
- Attack surface: LiteLLM API key management endpoint(s) exposed to authenticated users (e.g., internal_user role).
- Required access: Valid internal_user credentials with permission to create API keys.
- Trigger point: Calling the API key generation function/endpoint and specifying privileged routes (such as admin-only routes) in the allowed_routes field.
- Why exploitation is possible: The server-side logic stores and honors the allowed_routes parameter without checking that these routes are a subset of the creator's existing permissions, causing the RBAC layer to trust an unvalidated client-supplied permission set.
Why this happens
The core issue is a broken authorization check in the API key creation workflow.
Instead of deriving or constraining the new key's permissions from the authenticated user's role, the system directly persists the client-supplied allowed_routes list and subsequently uses it as an authoritative source of permissions.
This aligns with CWE-863: Improper Authorization, where the system fails to enforce authorization decisions and trusts user-controlled inputs for privilege assignments.
Conceptually, the bug represents an insecure pattern where permission scopes are set by the caller rather than being enforced by role-aware server-side logic.
Potential impact
- An internal_user may escalate privileges to proxy_admin or equivalent admin roles.
- Attackers can access admin-only routes that should be restricted, including sensitive configuration or management endpoints.
- Unauthorized modification of system settings, routing rules, or integration configurations.
- Potential exposure or manipulation of logs, billing, usage data, or connected model/provider credentials depending on what admin routes control.
- Lateral movement within the application environment using elevated capabilities granted by the forged API key.
General mitigation guidance
Effective mitigation focuses on ensuring that authorization decisions for newly created credentials are enforced server-side and derived from trusted state:
- Bind API key scopes and allowed_routes to the authenticated user's existing permissions, computing them on the server rather than accepting arbitrary client input.
- Enforce that any requested allowed_routes are validated as a subset of the creator's role-based permissions, rejecting or trimming routes outside that scope.
- Centralize RBAC logic so that permission checks are consistently applied for both direct user requests and API key–based requests.
- Apply a least-privilege model for roles and default API key scopes; new keys should have minimal privileges unless explicitly elevated by an authorized administrator path.
- Introduce clear separation between administrative key creation flows and non-administrative key creation, with stronger controls and review on admin-level operations.
How teams detect issues like this
Organizations can detect and monitor for this class of authorization flaw using:
- Static analysis and code review:
- Search for endpoints that create or update API keys, tokens, or client credentials where permission sets or allowed_routes are taken directly from request parameters.
- Flag any authorization logic that checks only authentication (who is the user) but does not verify whether the user is allowed to assign specific scopes or routes.
- Review RBAC middleware or policy modules to ensure they are consistently applied to both user and API key–based requests.
- Runtime monitoring and logging:
- Log API key creation events, including creator identity, assigned routes/scopes, and role context; alert when non-admin users create keys with admin-only routes.
- Monitor access logs for API keys associated with low-privilege users calling admin-only endpoints.
- Policy and automated checks:
- Implement CI/CD checks or security tests that attempt to create over-privileged keys using low-privilege roles as part of automated regression testing.
- Use automated review tools or security scanners that understand access-control patterns and can identify client-controlled scope assignment.

