Improper Output Neutralization for Logs in berriai/litellm
Description
In berriai/litellm before version 1.44.12, the litellm/litellm_core_utils/litellm_logging.py file contains a vulnerability where the API key masking code only masks the first 5 characters of the key. This results in the leakage of almost the entire API key in the logs, exposing a significant amount of the secret key. The issue affects version v1.44.9.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
API key masking in LiteLLM before v1.44.12 only obscures the first five characters of an API key, exposing nearly the entire key in log files.
Vulnerability
The API key masking logic in litellm/litellm_core_utils/litellm_logging.py in BerriAI/litellm before version 1.44.12 only masks the first five characters of the API key [1][2]. This results in logging almost the entire plaintext secret, with only a small portion replaced by asterisks. The vulnerability was present in version v1.44.9 [2].
Exploitation
An attacker with access to the server's log files can retrieve the full API key from the masked string, as the mask covers only the first five characters while the remainder of the key remains visible [1][2]. No special privileges are required beyond log access; the logs are generated during normal API calls and stored in standard logging destinations [2].
Impact
Exposing almost the entire API key allows an attacker to authenticate to the LLM provider service(s) that the key was intended to protect. This could lead to unauthorized use of the provider's API, data exfiltration, or financial charges incurred by the key owner [1][2].
Mitigation
The issue was fixed in commit 9094071, which updated the masking logic to only leave the last four characters of the key unmasked [3]. Users should upgrade to LiteLLM version 1.44.12 or later to apply the patch [2][3].
- GitHub - BerriAI/litellm: Python SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native) format, with cost tracking, guardrails, loadbalancing and logging. [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, VLLM, NVIDIA NIM]
- NVD - CVE-2024-9606
- fix(litellm_logging.py): only leave last 4 char of gemini key unmasked · BerriAI/litellm@9094071
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
litellmPyPI | < 1.44.12 | 1.44.12 |
Affected products
3- berriai/berriai/litellmv5Range: unspecified
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4News mentions
0No linked articles in our index yet.