T08 · Insecure Dependencies
- Location
SKILL.md:24- Finding
Execution of Untrusted and Mutable Third-Party Projects
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 24-32
Vulnerability Type: Unsafe installation and execution of third-party repositories and dependencies
Risk Level: MediumVulnerable Code Snippet:
markdown 2. **Setup:** - Use `run_shell_command` to `git clone` the repository into a temporary directory (e.g., in `~/.gemini/tmp/`). - Read `README.md` or `CONTRIBUTING.md` to identify build/run instructions. 3. **Execution:** - Detect project type (Node.js, Python, Rust, Go, etc.). - Install dependencies (`npm install`, `pip install -r requirements.txt`, etc.). - Run the application or demo (`npm start`, `python main.py`, etc.). 4. **Verification:** - If it starts a web server, use `browser_navigate` to check `http://localhost:<port>`. - If it's a CLI tool, check the output for success/failure.Technical Analysis
The Skill directs the Agent to clone a mutable external repository, install its dependencies, and execute its application. Although this workflow requires user permission and uses a temporary directory, neither control provides a security boundary.
A temporary directory only changes the working location. Unless execution occurs in a properly isolated environment, cloned code and package-manager lifecycle hooks retain the Agent process's filesystem, process, and network privileges. Commands such as
npm installcan execute package lifecycle scripts, while Python and other ecosystems may execute arbitrary code during builds or when the downloaded application is started.The instructions do not require commit pinning, signature or provenance verification, dependency review, lifecycle-script suppression, network restrictions, filesystem isolation, or resource limits. Consequently, the code actually executed can differ from the repository state that was originally reviewed or presented to the user.
Attack Path
- An attacker publishes or compr ...[truncated 1420 chars]
- Remediation
View remediation
Remediation Suggestions
- Execute all external repositories inside a disposable container or virtual machine rather than relying on a temporary directory.
- Mount no host directories by default. If project access is necessary, provide a minimal read-only copy containing only approved files.
- Remove environment variables, credentials, SSH agents, cloud metadata access, package-manager tokens, and other secrets from the isolated environment.
- Disable outbound networking by default and allowlist only endpoints strictly required for dependency retrieval.
- Pin the repository to a specific reviewed commit and verify its origin, signature, or checksum where supported.
- Inspect dependency manifests, lockfiles, build files, and installation scripts before running package-manager commands.
- Prefer reproducible, lockfile-enforced installation modes and disable lifecycle scripts where feasible, such as
npm install --ignore-scripts. - Avoid blindly executing commands copied from repository-controlled documentation.
- Apply CPU, memory, process, execution-time, filesystem, and exposed-port limits.
- Present the exact commit, commands, network access, mounts, and isolation controls to the user before requesting execution permission.
