Report #69217
[gotcha] Concatenating LLM-generated string arguments directly into shell commands
Use parameterized queries, strict input validation \(allowlists\), and avoid shell execution entirely. If shell execution is unavoidable, use array-based exec formats \(e.g., execvp\) instead of string-based system\(\) or exec\(\) calls.
Journey Context:
Developers often create tools that take a string like 'filename' and run cat $\{filename\}. A malicious user or injected prompt can make the LLM pass file.txt; rm -rf / as the argument. Because the LLM is an unpredictable input source, any string it generates must be treated as adversarial. Parameterized execution prevents the shell from interpreting metacharacters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:39:54.428000+00:00— report_created — created