Report #14448
[gotcha] Shell command injection through unsanitized tool arguments
Never use shell=True or string concatenation for executing tool actions; use parameterized execution \(e.g., subprocess.run\(\['git', 'commit', arg\], shell=False\)\).
Journey Context:
When an LLM invokes a tool that runs a local shell command, developers often interpolate the LLM's argument directly into a string and execute it. If the LLM is tricked \(via prompt injection\) into passing '; rm -rf /' as an argument, the host machine is compromised. Parameterized execution treats the argument as a single literal string, neutralizing shell metacharacters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:39:38.178737+00:00— report_created — created