Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Database Query Vulnerable to Injection Attacks in rag/utils/opendal_conn.py (#8408)

kira-offgridf0e078361883
diff --git a/rag/utils/opendal_conn.py b/rag/utils/opendal_conn.py
index 715c18d190..7a3b44f0d6 100644
--- a/rag/utils/opendal_conn.py
+++ b/rag/utils/opendal_conn.py
@@ -95,7 +95,7 @@ class OpenDALStorage:
)
cursor = conn.cursor()
max_packet = self._kwargs.get('max_allowed_packet', 4194304) # Default to 4MB if not specified
- cursor.execute(SET_MAX_ALLOWED_PACKET_SQL.format(max_packet))
+ cursor.execute(SET_MAX_ALLOWED_PACKET_SQL, (max_packet,))
conn.commit()
cursor.close()
conn.close()