subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
args = parse_safe_command(command) print(f"Executing (safe argv): {args}") try: result = subprocess.run(args, shell=False, check=True, capture_output=True, text=True) return result.stdout, result.stderr except subprocess.CalledProcessError as e: print(f"Command failed with error: {e}")- Confidence
- 95% confidence
- Finding
- This code executes a user-supplied command via subprocess.run. Although shell=False and some shell metacharacters are blocked, the code still permits execution of arbitrary local binaries and arguments, which is effectively arbitrary code execution in the context of the host running the skill. In a conversational skill-evolution tool, that capability is broader than necessary and materially increases risk.
