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
- 92% confidence
- Finding
- This code executes a user-supplied command via subprocess.run. Although shell=False and token filtering reduce classic shell-injection risk, the script still permits arbitrary executable invocation, so an attacker who controls --command can run any local program with the privileges of this process. In a meta-skill that automatically trains and evolves other skills, that capability is especially dangerous because the workflow is explicitly designed to execute agent/task commands repeatedly and with little friction.
