subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
统一处理 subprocess 调用,避免重复代码。 """ try: result = subprocess.run( cmd_args, capture_output=True, text=True, timeout=timeout ) output = (result.stdout or "") + (result.stderr or "")- Confidence
- 84% confidence
- Finding
- `run_cmd` is a generic subprocess wrapper that executes whatever argument vector its caller supplies, with no allowlist, path validation, or trust boundary enforcement. In a skill that processes external media URLs and likely orchestrates multiple tools, this helper becomes a high-risk sink if any upstream input can influence `cmd_args`, enabling arbitrary local command execution by chaining untrusted input into this function.
