subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
console.print(f"📦 [cyan]Klone Repository:[/cyan] {repo_url}...") try: # depth 1 for performance, list for security subprocess.run(["git", "clone", "--depth", "1", repo_url, str(cache_dir)], check=True, capture_output=True, text=True) console.print(f"✓ Repository erfolgreich in den Cache geladen.") except Exception as e: console.print(f"[bold red]Fehler beim Klonen:[/bold red] {e}")- Confidence
- 80% confidence
- Finding
- Although the code avoids shell injection by using `subprocess.run` with an argument list, it still causes the system to invoke `git clone` on attacker-controlled remote content. Cloning untrusted repositories can expose the host to risks from git/protocol handling, local filesystem effects, and unexpected network access, especially in an agent context where this behavior broadens capability beyond passive analysis.
