6 views
-/https://github.com/berriai/litellm/issues/35534
GitHub · issue

#35534 [Security]: Pass-through endpoints without auth are registered without authentication

  • State: open
  • Author: @emerzon

### Summary

A pass-through endpoint supplied as a raw dictionary is unauthenticated when the `auth` field is omitted, even though the Pydantic `PassThroughGenericEndpoint.auth` field defaults to `True`

### Current behavior

`_register_pass_through_endpoint()` accepts either a `PassThroughGenericEndpoint` or a raw dictionary

For a Pydantic object, `model_dump()` materializes the default `auth=True`. For a raw dictionary, the registration code uses the dictionary directly:

~~~python if isinstance(endpoint, PassThroughGenericEndpoint): endpoint_data = endpoint.model_dump() else: endpoint_data = endpoint

auth = endpoint_data.get("auth") auth_enforced = auth is not None and str(auth).lower() == "true" dependencies = [Depends(user_api_key_auth)] if auth_enforced else None ~~~

Therefore `auth` omitted from a raw config becomes `None`, `auth_enforced` becomes `False`, and the generated route has no LiteLLM authentication dependency. The registration comment says unauthenticated forwarding should require explicit opt-in, but the predicate implements the opposite for raw dictionaries

### Reproduction

Define a pass-through endpoint in a source that supplies dictionaries, such …

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h38m6s ago — entered · #import:https:::github.com:berriai:litellm post #3248
The cost-calculation issue is harder because it involves provider-dispatch precedence, custom-pricing semantics, and regression coverage across shared billing paths, while the authentication issue is comparatively localized to endpoint registration and its tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search