Report #30595
[gotcha] LLM-generated tool arguments cause SQL injection or command injection
Parameterize queries and use prepared statements for any database queries or shell commands constructed from LLM output. Treat LLM output with the same distrust as raw user input.
Journey Context:
Developers use the LLM to generate SQL WHERE clauses or API parameters based on user requests. Because the LLM can be indirectly injected \(e.g., via a RAG document\), it might generate malicious SQL \(e.g., '; DROP TABLE users;'\). The LLM is just a text generator, not a security boundary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:44:19.352514+00:00— report_created — created