Documented Incident · INC-2025-27135 · High severity
RAGFlow Text-to-SQL Execution Component SQL Injection
CVE-2025-27135 disclosed a high-severity SQL injection flaw in the RAGFlow retrieval engine's automated natural-language-to-SQL execution component. Model-derived SQL fragments and user-influenced query parameters were concatenated directly into database calls without parameterized binding or abstract-syntax-tree validation. An attacker able to prompt or poison retrieval inputs could alter query semantics to read unauthorized tables, exfiltrate tenant records, or tamper with backend state depending on DB privileges. Upstream patches introduced stricter parameter handling, underscoring that generated SQL must run under read-only least-privilege database roles and AST allowlists.
Incident dossier metadata
- Case ID
INC-2025-27135- Classification
- Incident
- Date
- Severity
- High
- Sector
- Enterprise Data & Analytics
- Attack vector
- Tool/MCP Abuse
- System type
- Open-Source RAG & Database Query Assistants
- CVE / reference
CVE-2025-27135- Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2025-27135
Defensive takeaway
Execute model-generated database queries exclusively against read-only least-privilege credentials using AST-validated SELECT allowlists and strict query timeouts.
Mapped AI security techniques
- LLM Prompt Injection AML.T0051
- AI Agent Tool Invocation AML.T0053
- Data from AI Services: RAG Databases AML.T0085.000
- Exfiltration via AI Agent Tool Invocation AML.T0086
Mapped defensive controls
Source citation records
- NVD Record CVE-2025-27135: RAGFlow SQL Injection in Text-to-SQL Component · NIST National Vulnerability Database (NVD) ·