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
- 95% confidence
- Finding
- The code automatically installs a Python package at runtime using pip when an import fails. Even though the command is invoked without a shell, this still expands the skill's trust boundary to the package index and the execution environment, enabling unreviewed code download and install during normal operation; if pip configuration, index settings, or package resolution are compromised, arbitrary code may be introduced.
