SQL injection in litellm
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 software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | litellm | < 1.40.0 | 1.40.0 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-5225
- https://github.com/BerriAI/litellm/pull/3940
- https://github.com/BerriAI/litellm/commit/f75c15d6cd535aa78014378ad532de1df6be2f56
- https://github.com/BerriAI/litellm
- https://huntr.com/bounties/491e4884-0306-4cd4-8fe2-9a19de33bf5c
- https://pypi.org/project/litellm
- https://github.com/advisories/GHSA-h6m6-jj8v-94jj
- CVSS vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N- Weakness (CWE)
CWE-89- Platform
- Python (PyPI)
- Package
litellm- Disclosed
- 06.06.2024
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-1550 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-h6m6-jj8v-94jj - CC BY 4.0
Vulnerability history: litellm
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 42
- First → latest
- 04.2024 09.2026
- Without a fix
- 14
- Exploited in attacks
- 3
Severity breakdown
- Critical 7
- High 17
- Medium 8
- Low 9
- Unrated 1
Disclosures per year
- 2024: 8
- 2025: 6
- 2026: 28
-
SQL injection in litellm this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.