Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. litellm
  4. ›
  5. CVE-2024-5225

CVE-2024-5225: SQL injection in litellm

June 6, 2024

An SQL Injection vulnerability exists in the berriai/litellm repository, specifically within the /global/spend/logs endpoint. The vulnerability arises due to improper neutralization of special elements used in an SQL command. The affected code constructs an SQL query by concatenating an unvalidated api_key parameter directly into the query, making it susceptible to SQL Injection if the api_key contains malicious data. This issue affects the latest version of the repository. Successful exploitation of this vulnerability could lead to unauthorized access, data manipulation, exposure of confidential information, and denial of service (DoS).

References

  • github.com/BerriAI/litellm
  • github.com/BerriAI/litellm/commit/f75c15d6cd535aa78014378ad532de1df6be2f56
  • github.com/BerriAI/litellm/pull/3940
  • github.com/advisories/GHSA-h6m6-jj8v-94jj
  • huntr.com/bounties/491e4884-0306-4cd4-8fe2-9a19de33bf5c
  • nvd.nist.gov/vuln/detail/CVE-2024-5225

Code Behaviors & Features

Detect and mitigate CVE-2024-5225 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.40.0

Fixed versions

  • 1.40.0

Solution

Upgrade to version 1.40.0 or above.

Impact 6.4 MEDIUM

CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Source file

pypi/litellm/CVE-2024-5225.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:06 +0000.