subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
for pkg in pip_fixable: print(f"\n 正在安装 {pkg} ...") try: r = subprocess.run( [sys.executable, "-m", "pip", "install", pkg], capture_output=True, text=True, timeout=120 )- Confidence
- 92% confidence
- Finding
- The code will automatically invoke pip to install packages when '--fix' is supplied, which changes the local environment and executes package installation logic from package indexes. Although the package names are hardcoded, this still creates supply-chain and unintended-modification risk, especially in an agent skill that may be run by users without fully understanding the side effects.
