subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
python_path = self._ensure_venv() pip_path = os.path.join(self.venv_path, "bin", "pip.exe") if os.name == "nt" else os.path.join(self.venv_path, "bin", "pip") print(f"📥 安装 SearXNG 到 {self.venv_path}") subprocess.run([pip_path, "install", "searxng"], check=True, timeout=120) return True except Exception as e: print(f"❌ 安装失败: {e}")- Confidence
- 84% confidence
- Finding
- The code installs the unpinned package "searxng" from the package index at runtime, which creates a software supply-chain risk. An attacker controlling dependency resolution, a compromised package, or a hostile index/proxy could cause arbitrary code execution on the host during installation.
