subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
"""运行命令并显示进度""" print(f"🔧 {description}...") try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True) if result.returncode == 0: print(f" ✅ 完成") return True- Confidence
- 98% confidence
- Finding
- The helper executes a shell command via subprocess.run(..., shell=True), which is dangerous because shell parsing introduces command-injection risk if any part of the command string becomes attacker-controlled now or in future modifications. In this script the string is assembled from sys.executable and dependency specifiers, so immediate exploitability is limited, but installers are high-risk code paths and the shell use is unnecessary.
