CVE-2024-6587: Litellm LiteLLM Server-Side Request Forgery (SSRF) Vulnerability

HIGH
Advisory Identifier: GHSA-g26j-5385-hhw3
CVSS 7.5
CWE-918
Published
Advisory Summary

CVE-2024-6587 is a HIGH (CVSS 7.5) litellm server-side request forgery (ssrf) vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Litellm libraries in the PyPI ecosystem. The issue involves litellm server-side request forgery (ssrf) vulnerability. Remediation is available by upgrading affected packages to version 1.44.8.

CVE-2024-6587 at a Glance

CVE Identifier CVE-2024-6587
GHSA Identifier GHSA-g26j-5385-hhw3
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
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-6587

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.8
pip install litellm>=1.44.8
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-6587, 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.8), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. 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

A Server-Side Request Forgery (SSRF) vulnerability exists in berriai/litellm version 1.38.10. This vulnerability allows users to specify the `api_base` parameter when making requests to `POST /chat/completions`, causing the application to send the request to the domain specified by `api_base`. This request includes the OpenAI API key. A malicious user can set the `api_base` to their own domain and intercept the OpenAI API key, leading to unauthorized access and potential misuse of the API key.

CVE-2024-6587 Affected Litellm Versions

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

References

Frequently Asked Questions

What is CVE-2024-6587?
CVE-2024-6587 is a security vulnerability in Litellm involving LiteLLM Server-Side Request Forgery (SSRF) vulnerability under CWE-918: Server-Side Request Forgery (SSRF).
Which Litellm versions are affected?
Affected versions include releases prior to 1.44.8 across affected packages: litellm.
What version fixes CVE-2024-6587?
Upgrading to 1.44.8 (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.8. Upgrade your dependency to 1.44.8 or later.
What is the CVSS score of CVE-2024-6587?
CVE-2024-6587 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-6587?
CVE-2024-6587 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2024-6587?
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-g26j-5385-hhw3",
  "modified" : "2024-09-13T19:29:08Z",
  "published" : "2024-09-13T18:31:47Z",
  "aliases" : [ "CVE-2024-6587" ],
  "summary" : "LiteLLM Server-Side Request Forgery (SSRF) vulnerability",
  "details" : "A Server-Side Request Forgery (SSRF) vulnerability exists in berriai/litellm version 1.38.10. This vulnerability allows users to specify the `api_base` parameter when making requests to `POST /chat/completions`, causing the application to send the request to the domain specified by `api_base`. This request includes the OpenAI API key. A malicious user can set the `api_base` to their own domain and intercept the OpenAI API key, leading to unauthorized access and potential misuse of the API key.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "litellm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.44.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6587"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/berriai/litellm/commit/ba1912afd1b19e38d3704bb156adf887f91ae1e0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/berriai/litellm"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/4001e1a2-7b7a-4776-a3ae-e6692ec3d997"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-13T19:29:08Z",
    "nvd_published_at" : "2024-09-13T16:15:04Z"
  }
}