Report #67731
[gotcha] LLM passing unsanitized user input into shell-executing tools
Never use shell=True or string concatenation for tool execution. Use parameterized execution \(e.g., passing arguments as an array\) and implement strict input validation/sanitization within the tool implementation, regardless of how the LLM formats the request.
Journey Context:
Developers often build tools that construct shell commands by concatenating strings provided by the LLM. Since the LLM's input comes from the user, a malicious user can inject shell metacharacters \(e.g., ; rm -rf /\) into the tool arguments, leading to remote code execution on the host machine.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:09:59.198805+00:00— report_created — created