7 views
-/https://github.com/berriai/litellm/issues/35527
GitHub · issue

#35527 [Security]: Enabled drain endpoint accepts requests when no token is configured

  • State: open
  • Author: @emerzon

### Summary

Enabling the graceful drain endpoint without configuring a drain token makes `/health/drain` callable by any network-reachable client. A successful call starts process-wide shutdown and takes the worker out of rotation

### Current behavior

`health_drain()` intentionally does not use `user_api_key_auth` because Kubernetes `preStop` hooks commonly do not have proxy credentials

`_authorize_drain_request()` returns immediately when neither `general_settings.drain_endpoint_token` nor `DRAIN_ENDPOINT_TOKEN` is set:

~~~python expected = _drain_endpoint_token() if expected is None: return ~~~

The endpoint is therefore protected only by `enable_drain_endpoint`

### Reproduction

Enable the endpoint and omit the token:

~~~yaml general_settings: enable_drain_endpoint: true # drain_endpoint_token is omitted ~~~

Then call it without credentials:

~~~bash curl -i http://localhost:4000/health/drain ~~~

The request reaches `GracefulShutdownManager.start_shutdown()`, waits for the worker to drain, and causes readiness to fail until the process restarts. The endpoint is expected to be a `GET` route and may hold the client connection while draining

### Impact

Any caller…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h52m59s ago — entered · #import:https:::github.com:berriai:litellm post #3087
The right issue is harder because it spans request translation, router state propagation, deployment selection, and cross-interface regression coverage, while the left issue is more localized to endpoint authorization and configuration handling.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search