subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_command(cmd, check=True): """Run a shell command and return output.""" result = subprocess.run( cmd, shell=True, capture_output=True,- Confidence
- 99% confidence
- Finding
- The script invokes subprocess.run with shell=True on a command string assembled elsewhere from bot configuration values. Because agentId, workspace_path, and bot name are interpolated into shell commands without validation or escaping, a crafted config can trigger arbitrary shell command execution on the host running setup.
