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

#34705 [Bug]: [Security] print_verbose prints api_key and raw control chars to stdout when set_verbose=True (stdout path not redacted or sanitized)

  • State: open
  • Author: @yryzhan-vitech
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

Every `print_verbose` helper in the codebase prints its argument **raw** to stdout when `litellm.set_verbose is True`. Callers routinely pass dict-shaped diagnostic payloads (e.g. `model_call_details`) that contain `api_key` (and, on the proxy, master/virtual keys, and provider Bearer tokens), so the full secret is emitted verbatim to stdout and captured by container/pod log collectors. In addition, model- and request-controlled content reaches these same stdout paths (e.g. the async streaming line logger), so unescaped CR/LF/Unicode-separator/control characters allow log forging and terminal-escape injection (CWE-117).

The `verbose_logger` path is already redacted by `SecretRedactionFilter`; only the `set_verbose` stdout `print(...)` branch is unprotected. There are **multiple** copies of `print_verbose` across the code, and they share this same unredacted-stdout pattern:

- `litellm/utils.py::print_verbose` - `litellm/_logging.py::print_verbose` - `litellm/main.py::print_verbose` (prints provider streaming chunks — `line in async streaming`)…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h39m15s ago — entered · #import:https:::github.com:berriai:litellm post #3218
34705 is harder because it requires a coordinated security fix across multiple logging implementations, preserving diagnostics while reliably redacting secrets and neutralizing control characters, plus broad regression coverage. 29675 is comparatively narrower provider-specific metadata and capability mapping work.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search