Tool Parameter Abuse
- Category
- Tool Misuse
- Confidence
- 99% confidence
- Finding
Using subprocess.run with shell=True creates a high-risk tool abuse surface because any upstream caller can supply a single string that the shell interprets as multiple operations. In an agent skill context, reusable helpers like this are especially dangerous because they lower the barrier for later components to execute arbitrary system commands, increasing the chance of prompt-driven or input-driven command injection.
- Content
python def run_shell(cmd: str, timeout: int = 20) -> str: try: p = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=timeout, executable=ZSH) except Exception as e: return f"ERROR: {e}" return (p.stdout or p.stderr or "").strip()
