CVE-2024-9606: Litellm LiteLLM Reveals Portion Of API Vulnerability

HIGH
Advisory Identifier: GHSA-g5pg-73fc-hjwq
CVSS 7.5
CWE-117
Published
Advisory Summary

CVE-2024-9606 is a HIGH (CVSS 7.5) litellm reveals portion of api vulnerability (CWE-117: Improper Output Neutralization for Logs) affecting Litellm libraries in the PyPI ecosystem. The issue involves litellm reveals portion of api key via a logging file. Remediation is available by upgrading affected packages to version 1.44.12.

CVE-2024-9606 at a Glance

CVE Identifier CVE-2024-9606
GHSA Identifier GHSA-g5pg-73fc-hjwq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-117: Improper Output Neutralization for Logs
Affected Product Litellm
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-9606

To remediate this vulnerability, upgrade all affected Litellm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

litellm fixed: 1.44.12
pip install litellm>=1.44.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show litellm

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-9606, inspect your installed packages using pip:

pip show litellm

Analyze the terminal output to locate any version of Litellm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.44.12), your application is affected.

Note: The pip show litellm command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-117: Improper Output Neutralization for Logs, where the product constructs a log message from external input, but it does not neutralize or incorrectly neutralizes special elements when the message is written to a log file. In Litellm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2024-9606 Affected Litellm Versions

1 component(s)
Fixed Versions:
1.44.12
Product / Package Ecosystem Affected Versions Fixed Version
litellm
PyPI
< 1.44.12
1.44.12

References

Frequently Asked Questions

What is CVE-2024-9606?
CVE-2024-9606 is a security vulnerability in Litellm involving LiteLLM Reveals Portion of API Key via a Logging File under CWE-117: Improper Output Neutralization for Logs.
Which Litellm versions are affected?
Affected versions include releases prior to 1.44.12 across affected packages: litellm.
What version fixes CVE-2024-9606?
Upgrading to 1.44.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is litellm affected?
Yes, litellm is affected in releases prior to 1.44.12. Upgrade your dependency to 1.44.12 or later.
What is the CVSS score of CVE-2024-9606?
CVE-2024-9606 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-9606?
CVE-2024-9606 is classified under CWE-117: Improper Output Neutralization for Logs (The product constructs a log message from external input, but it does not neutralize or incorrectly neutralizes special elements when the message is written to a log file.).
How can I check PyPI dependencies for CVE-2024-9606?
Run the dependency tree command: 'pip show litellm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g5pg-73fc-hjwq",
  "modified" : "2025-03-20T21:02:06Z",
  "published" : "2025-03-20T12:32:51Z",
  "aliases" : [ "CVE-2024-9606" ],
  "summary" : "LiteLLM Reveals Portion of API Key via a Logging File",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "litellm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.44.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-9606"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/berriai/litellm/commit/9094071c4782183e84f10630e2450be3db55509a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/BerriAI/litellm"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/4a03796f-a8d4-4293-84ef-d3959456223a"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-117" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-20T21:02:06Z",
    "nvd_published_at" : "2025-03-20T10:15:49Z"
  }
}