---
id: CVE-2024-5225
aliases:
  - GHSA-h6m6-jj8v-94jj
  - PYSEC-2026-1550
title: SQL injection in litellm
summary: SQL injection in litellm
severity: medium
cvss: 6.4
cvssVector: 'CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N'
vendor: litellm
product: litellm
ecosystem: pip
affected:
  - litellm < 1.40.0
patched:
  - litellm 1.40.0
published: '2024-06-06'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:50:15.470806763Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-h6m6-jj8v-94jj'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2024-5225'
  - url: 'https://github.com/BerriAI/litellm/pull/3940'
  - url: >-
      https://github.com/BerriAI/litellm/commit/f75c15d6cd535aa78014378ad532de1df6be2f56
  - url: 'https://github.com/BerriAI/litellm'
  - url: 'https://huntr.com/bounties/491e4884-0306-4cd4-8fe2-9a19de33bf5c'
tags:
  - osv
  - pip
epss: 0.00429
epssPercentile: 0.36722
ingestedAt: '2026-07-08T18:25:50.001Z'
---

## Overview

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).

## Affected packages

- `litellm < 1.40.0`

## Remediation

Upgrade to a patched release:

- `litellm 1.40.0`
