mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(proxy_server.py): security fix - fix sql injection attack on global spend logs
This commit is contained in:
parent
1ec2ba186f
commit
f75c15d6cd
1 changed files with 4 additions and 8 deletions
|
@ -8693,17 +8693,13 @@ async def global_spend_logs(
|
|||
|
||||
return response
|
||||
else:
|
||||
sql_query = (
|
||||
"""
|
||||
sql_query = """
|
||||
SELECT * FROM "MonthlyGlobalSpendPerKey"
|
||||
WHERE "api_key" = '"""
|
||||
+ api_key
|
||||
+ """'
|
||||
WHERE "api_key" = $1
|
||||
ORDER BY "date";
|
||||
"""
|
||||
)
|
||||
"""
|
||||
|
||||
response = await prisma_client.db.query_raw(query=sql_query)
|
||||
response = await prisma_client.db.query_raw(sql_query, api_key)
|
||||
|
||||
return response
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue