T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Automatically Installed Dependency Is Not Reproducibly Pinned
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1andscripts/run_gemini_search.sh:5-7
Vulnerability Type: Insecure third-party dependency management
Risk Level: MediumVulnerable code in
requirements.txt:text google-genai>=1.0.0Installation code in
scripts/run_gemini_search.sh:bash if [[ ! -x "$PY" ]]; then python3 -m venv "$DIR/.venv" "$DIR/.venv/bin/python" -m pip install -r "$DIR/requirements.txt" fiTechnical Analysis
The wrapper automatically installs
google-genaiwhen the local virtual environment does not exist. The requirement specifies only a lower version boundary, so pip may install any current or future release at or above version 1.0.0, together with unpinned transitive dependencies.No lock file, exact version constraint, or package hash verification is present. Therefore, installing the Skill at different times can cause different third-party code to execute even though the audited project files have not changed.
This does not establish that the current package is malicious. The risk arises because future dependency resolution is not reproducible or cryptographically constrained. A compromised upstream release or transitive dependency could execute installation or runtime code with the invoking user's permissions. At runtime, the dependency is also loaded into the same Python process that receives the Gemini API key.
Attack Path
- An attacker compromises an eligible future
google-genairelease, a transitive dependency, or the relevant package distribution channel. - A user invokes
scripts/run_gemini_search.shwhere the project-local.venvdoes not already contain an executable Python interpreter. - The wrapper creates the virtual environment and runs pip automatically.
- Pip resolves the unconstrained newer package or compromised transitive dependency.
- Attacker-controlled installation or runtime code execu ...[truncated 937 chars]
- An attacker compromises an eligible future
- Remediation
View remediation
Remediation Suggestions
- Replace the open-ended version constraint with a reviewed, exact version.
- Generate a lock file that fixes all transitive dependency versions.
- Record and enforce package hashes, then install with
pip install --require-hashes. - Use an explicitly trusted package index and disable unintended extra indexes to reduce dependency-confusion exposure.
- Update dependencies only through a controlled review process that includes vulnerability scanning and regression testing.
- Consider separating environment provisioning from normal Skill execution so invocation does not automatically download and execute newly resolved third-party packages.
- Rebuild the virtual environment from the reviewed lock file when dependencies are intentionally updated.
