CVE-2024-9606: LiteLLM Reveals Portion of API Key via a Logging File
LiteLLM before 1.44.12 masked only five characters of an API key before writing it to its logs, so almost the whole secret was readable by anyone with access to the logs. Upgrade to litellm 1.44.12 and rotate any key that may have been logged by an earlier version.
Published Mar 20, 2025 · Analysis Nov 1, 2026
What an attacker can do
The bug is in litellm/litellm_core_utils/litellm_logging.py. The masking code hides only the first five characters of the key and leaves the rest in plain text. The fix commit shows the masking line operating on an api_base string that carries a key= value. The old code starred the five characters after key= and kept the remainder. The fixed line keeps only the last four characters.
No network attack is needed against LiteLLM itself. The exposure comes from who can read the logs: log aggregation platforms, shared CI output, support bundles, observability vendors and anyone with shell access to the host. A leaked provider key lets the holder call the model API at your cost and read what that key can access. The CVSS vector scores a confidentiality impact only. The report names v1.44.9 as affected.
Who is affected
The litellm PyPI package before 1.44.12. The issue was reported against v1.44.9. Exposure depends on the logging path being active and on which logs get stored or shared. Check the installed version:
pip show litellmThen search stored logs for provider key patterns, for example strings starting key= followed by many visible characters.
litellm
- Ecosystem
- PyPI
- Affected
- < 1.44.12
- Fixed in
- 1.44.12
- Check
pip show litellm
How to fix it
Upgrade to litellm 1.44.12.
pip install -U "litellm>=1.44.12"Upgrading stops new leaks but does not remove keys already written. Rotate every provider key that LiteLLM handled while a vulnerable version was running, and purge or restrict old log files and any copies in log platforms. The sources name no other workaround.
How to tell if you were hit
Search your LiteLLM logs, and any central log store they feed, for key= values, and for key prefixes from your providers such as sk-. A match that shows more than the last four characters of a key means a vulnerable version logged it. Check the provider's usage dashboard for calls you do not recognise on keys that appeared in logs.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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.
Questions
- Which LiteLLM version fixes CVE-2024-9606?
1.44.12. Earlier versions are affected, and the report names v1.44.9.
- Do I need to rotate keys after upgrading?
If a vulnerable version logged your keys, yes. The upgrade only changes future log output. Keys already in log files stay readable until you rotate them and clean up the logs.
- Can a remote attacker exploit CVE-2024-9606 directly?
Not on its own. The flaw exposes secrets in log output. An attacker needs to read the logs, or the systems that store or forward them.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LiteLLM vulnerabilities
All LiteLLM entriesCVE-2026-114612
LiteLLM: Privilege Escalation to Proxy Admin via Cross-Domain Reuse of the Salt Key
high9.9Oct 27, 2026GHSA-g5ff-637f-6q2m
LiteLLM: internal_user_viewer arbitrary local file read via `vertex_ai_credentials`
high8.1Oct 27, 2026GHSA-hhww-mrg2-969h
LiteLLM vulnerable to reflected XSS in /sso/debug/callback
medium6.8Oct 27, 2026CVE-2026-84377
LiteLLM: Authenticated SSRF and provider-credential exfiltration via unvalidated request-body routing parameters
medium6.5Sep 30, 2026CVE-2026-59823
LiteLLM Proxy has server-side request forgery via the `user_config` request parameter
medium5.3Sep 17, 2026CVE-2026-37004
LiteLLM vulnerable to server-side template injection in the /prompts/test endpoint
critical9.8Aug 27, 2026
