Report #79742
[gotcha] LLM passing attacker-controlled strings as arguments to shell or SQL tools
Never pass raw LLM-generated arguments directly to shell commands \(e.g., os.system\) or raw SQL. Use parameterized queries, strict schema validation, and subprocess arrays rather than string concatenation.
Journey Context:
If an LLM has a tool to run a shell command or query a database, and the user input contains ; DROP TABLE users; or && rm -rf /, the LLM might blindly include this in the tool argument. Developers assume the LLM will sanitize the input, but LLMs are pattern matchers, not security filters. Parameterized queries and array-based subprocess calls neutralize the injection regardless of what the LLM generates.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:26:39.535722+00:00— report_created — created