Tool Parameter Abuse
- Category
- Tool Misuse
- Confidence
- 95% confidence
- Finding
Using shell=True creates a tool-parameter abuse surface because the shell interprets metacharacters, expansions, and chained commands rather than executing a single intended program directly. Although the current commands are static, this skill’s purpose is to process command output, so reuse or extension could easily evolve into passing agent-controlled command strings into this function, at which point exploitation would become severe.
- Content
python def run(cmd: str, cwd: str) -> str: p = subprocess.run(cmd, shell=True, cwd=cwd, capture_output=True, text=True) return p.stdout + p.stderr
