SQL injection in litellm
The `/global/spend/logs` endpoint in litellm builds an SQL query by concatenating an unvalidated `api_key` parameter, allowing SQL injection. An attacker could exploit this to gain unauthorised access, manipulate data, expose confidential information, or cause denial of service.
BerriAI/litellm
Originally disclosed on huntr
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).
From the GitHub Advisory Database (GHSA-h6m6-jj8v-94jj, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Successful exploitation could lead to unauthorised access, data manipulation, exposure of confidential information, and denial of service.
What the attacker needed
Access to the /global/spend/logs endpoint
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
SQL injection is when user input is inserted into a database command without being checked, so an attacker can change the command's meaning. Here, the `api_key` value is placed straight into an SQL query, so a malicious value could let someone read or change data they should not. The endpoint is `/global/spend/logs`.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.