T03 · Remote Payload Retrieval and Execution
- Location
ui/dependency_installer.py:366- Finding
Unauthenticated Arbitrary Repository Installation and Dependency Code Execution
- Content
View full analysis
dict: """Install missing custom nodes and/or models.""" repo_urls = data.get("repo_urls", []) models = data.get("models", []) locale = data.get("locale", "zh") if not repo_urls and not models: raise HTTPException( status_code=400, detail="repo_urls list or models list is required", ) try: server = get_server_by_id(server_id) if server is None: raise FileNotFoundError(f"Server '{server_id}' not found") installer = DependencyInstaller(server["url"], server.get("auth", "")) report = await asyncio.to_thread( installer.install_all, repo_urls, models or None ) ``` ```python # ui/dependency_installer.py:366-395 def _try_git_clone(self, repo_url: str, pkg_name: str) -> InstallResult | None: """Attempt installation via direct git clone.""" custom_nodes_dir = Path(self._guess_comfyui_path()) / "custom_nodes" if not custom_nodes_dir.is_dir(): return None target_dir = custom_nodes_dir / pkg_name if target_dir.exists(): return InstallResult( success=True, package_name=pkg_name, source=repo_url, message="directory already exists", method="git_clone", needs_restart=True, ) try: result = subprocess.run( ["git", "clone", repo_url, str(target_dir)], capture_output=True, text=True, timeout=300, ) if result.returncode != 0: return InstallResult( success ...[truncated 3025 chars]- Remediation
View remediation
