mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Fix SQL injection vulnerability in cache cleanup
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -228,10 +228,11 @@ class LLMResponseCacheStorage:
|
||||
logger.info("Deleting all cache entries (max_age_days <= 0)")
|
||||
else:
|
||||
cursor.execute(
|
||||
f"""
|
||||
DELETE FROM llm_response_cache
|
||||
WHERE timestamp < datetime('now', '-{max_age_days} days')
|
||||
"""
|
||||
DELETE FROM llm_response_cache
|
||||
WHERE timestamp < datetime('now', ? || ' days')
|
||||
""",
|
||||
(f"-{max_age_days}",)
|
||||
)
|
||||
deleted_count = cursor.rowcount
|
||||
|
||||
|
||||
Reference in New Issue
Block a user