subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_command(cmd: str) -> Tuple[int, str]: """Run shell command and return exit code + output.""" result = subprocess.run(cmd, shell=True, capture_output=True, text=True) return result.returncode, result.stdout + result.stderr def extract_metric(output: str, pattern: str) -> Optional[float]:- Confidence
- 98% confidence
- Finding
- The script executes the --verify argument with subprocess.run(..., shell=True), so any user-provided string is interpreted by the shell and can run arbitrary commands. In an autonomous/agent-oriented skill, this is especially dangerous because the tool encourages iterative execution and may normalize running attacker-influenced commands repeatedly.
