Langroid SQLChatAgent Prompt-to-SQL Injection Leading to Remote Code Execution
LLM-generated SQL executed without validation lets prompt injection reach COPY ... FROM PROGRAM and equivalent dialect RCE primitives on the database host
Langroid, an open-source framework for building LLM-powered agents, ships a SQLChatAgent that lets a language model write and execute SQL against a connected database. Versions before 0.63.0 pass the LLM's SQL output straight to the database with no statement-type validation, so a prompt injection — even indirect, via data the agent later reads — can steer the model into emitting administrative primitives instead of SELECTs. Where the database role has code-execution privileges (Postgres pg_execute_server_program, MySQL FILE, MSSQL xp_cmdshell), this becomes full remote code execution on the database host. Fixed in 0.63.0.
Members only
Full technical analysis, attack chain, IOCs, and the defensive checklist are available to registered members — free to join.