T08 · Insecure Dependencies
Warning
- Location
- scripts/generate_image.py:2
- Finding
- Unpinned Runtime Dependencies Allow Unreviewed Package Versions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/generate_image.py`, lines 2-7 **Vulnerability Type**: Supply-chain exposure through non-deterministic dependency resolution **Risk Level**: Medium ### Vulnerable Code ```python # /// script # requires-python = ">=3.10" # dependencies = [ # "google-genai>=1.0.0", # "pillow>=10.0.0", # ] # /// ``` The documented execution command in `SKILL.md`, lines 13-17, invokes the script through `uv run`: ```bash uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 1K|2K|4K] [--api-key KEY] ``` ### Technical Analysis Both third-party dependencies use open-ended minimum-version constraints. The project contains no reviewed lockfile or dependency hashes. Consequently, `uv run` can resolve and install a future compatible release whose code was not included in this audit. Python packages can execute code during installation or import. This script imports both dependencies and subsequently gives the Google client access to the API credential, prompt, and optional input image. This does not establish that either current dependency is malicious; the issue is that execution is not reproducible and the effective dependency code can change after review. ### Attack Path 1. An upstream dependency release or configured package source is compromised, or a future compatible release introduces malicious behavior. 2. The user invokes the documented `uv run` command. 3. Dependency resolution selects the affected release because the requirement accepts every version at or above the stated minimum. 4. The package is installed and imported into the process. 5. Malicious package code executes with the same operating-system privileges and environment access as the Agent process. ### Impact Assessment Successful exploitation could expose the `GEMINI_API_KEY`, prompts, input images, and other files or environment variables accessibl ...[truncated 205 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin every dependency to an exact, reviewed version rather than an open-ended minimum version. - Generate and commit a lockfile that records all transitive dependencies. - Require verified package hashes where supported. - Use only a trusted package index and prevent fallback to untrusted indexes. - Regularly scan locked dependencies for known vulnerabilities. - Review and deliberately update the lockfile instead of resolving new versions during ordinary skill execution. - Consider executing image generation in a sandbox with access only to the required input, output directory, and API credential. ]]>
