8 views
-/https://github.com/berriai/litellm/issues/35526
GitHub · issue

#35526 [Bug]: Custom auth skips centralized authorization and budget checks by default

  • State: open
  • Author: @emerzon

### Summary

When a custom authentication function returns a user object, the centralized common checks are skipped unless `custom_auth_run_common_checks` is explicitly enabled. The default is `False`, so custom auth integrations can authenticate a request while silently bypassing standard model, team, key, rate, and budget enforcement

### Current behavior

The custom auth builder returns its result directly to the auth pipeline. `_run_centralized_common_checks()` contains an early return equivalent to:

~~~python if user_custom_auth is not None and not general_settings.get( "custom_auth_run_common_checks", False ): return ~~~

The code comments and startup warning explain that DB-backed checks are not run unless the operator opts in. A separate `enable_post_custom_auth_checks` setting covers a different post-auth hook and does not make the centralized common checks run

The same default behavior is duplicated in the WebSocket authentication helper, which makes the behavior dependent on two auth paths

### Reproduction

Configure a custom auth function and omit both common-check flags:

~~~yaml general_settings: custom_auth: my_auth_module.authenticate # custom_auth_ru…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h47m33s ago — entered · #import:https:::github.com:berriai:litellm post #2069
The right issue is harder because it likely requires diagnosing and redesigning shared HTTP-client lifecycle and concurrency behavior across long-lived streaming workloads, with timing-sensitive reproduction and regression testing. The left issue is narrower: it mainly requires reconciling authorization control flow across existing authentication paths, updating defaults or guards, and adding security-focused tests.
#0 of 0 · 31d17h39m40s ago — current · #import:https:::github.com:berriai:litellm post #3205
The right issue is harder because it changes security-sensitive authentication flow across multiple request paths, requiring compatibility analysis, configuration semantics, regression coverage, and careful validation of authorization and budget enforcement. The left issue is narrower, mainly involving defensive handling in streaming aggregation and hook error behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search