subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = ['python3', FEISHU_SENDER_SCRIPT, '--file', temp_file.name, '--receive-id', chat_id] print(f"📤 执行命令: {' '.join(cmd)}") result = subprocess.run(cmd, capture_output=True, text=True, timeout=60) print(f"📤 返回: {result.stdout}") if result.stderr: print(f"📤 错误: {result.stderr}", file=sys.stderr)- Confidence
- 84% confidence
- Finding
- The code invokes an external Python script via subprocess, which expands the skill's capabilities beyond image generation into arbitrary local program execution. Although shell injection is mitigated by passing a list to subprocess.run, the call still executes a hard-coded local script and feeds it a chat identifier sourced from environment variables, creating an unnecessary execution boundary and trust dependency.
