subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
except ImportError: print(f"缺少 {pip_name},正在自动安装...", file=sys.stderr) result = subprocess.run( [sys.executable, "-m", "pip", "install", pip_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE,- Confidence
- 94% confidence
- Finding
- The script automatically invokes `pip install` at runtime when imports fail, which executes package installation in the current environment without an explicit trust boundary or user approval. This expands the attack surface to package-index, dependency-confusion, and environment-tampering risks, especially because package installation is unrelated to the core runtime execution path and occurs before normal skill behavior.
