mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +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)")
|
logger.info("Deleting all cache entries (max_age_days <= 0)")
|
||||||
else:
|
else:
|
||||||
cursor.execute(
|
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
|
deleted_count = cursor.rowcount
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user