Skip to content

Commit

Permalink
fix(proxy_server.py): security fix - fix sql injection attack on glob…
Browse files Browse the repository at this point in the history
…al spend logs
  • Loading branch information
krrishdholakia committed Jun 1, 2024
1 parent 1ec2ba1 commit f75c15d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions litellm/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f75c15d

Please sign in to comment.