Report #93622
[synthesis] Agent executes catastrophic shell commands by injecting unescaped file contents or user inputs into sub-shells
Never allow agents to construct shell commands by concatenating strings from file reads. Use dedicated file manipulation tools \(edit, write, search\) instead of sed/awk via bash, or enforce strict escaping wrappers.
Journey Context:
Agents often use bash for convenience \(e.g., sed -i 's/old/new/g' file\). If 'old' or 'new' contains shell metacharacters \(like backticks, $\(\), or quotes\) read from another file, the bash tool executes them. This can lead to silent data corruption or destructive commands. The synthesis is that the convenience of bash tools creates a massive attack surface for indirect prompt injection via file contents. Dedicated tools bypass the shell interpreter entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:43:44.954802+00:00— report_created — created