T08 · Insecure Dependencies
Warning
- Location
- scripts/generate_video.py:2
- Finding
- Unpinned Third-Party Dependency## Vulnerability Details **File Location**: `scripts/generate_video.py`, lines 2–5 **Vulnerability Type**: Unrestricted dependency resolution **Risk Level**: Medium ### Vulnerable Code ```python # /// script # requires-python = ">=3.10" # dependencies = ["requests"] # /// ``` ### Technical Analysis The script declares `requests` without an exact version, lockfile, or integrity hash. The documented execution command, `uv run scripts/generate_video.py`, may therefore resolve and install packages from mutable package-index state at runtime. This creates a supply-chain risk because the exact dependency graph used during execution is not guaranteed to match the graph reviewed during the audit. A compromised package release, compromised transitive dependency, unsafe package source, or future incompatible release could introduce attacker-controlled code into the process. Python dependency initialization and imports execute with the same permissions as the script. In this case, the process can access the Runway API key, the user-selected source image, the configured output location, and the network. ### Attack Path 1. An attacker compromises a future release of `requests`, one of its resolved dependencies, or the package source used by `uv`. 2. A user invokes the documented command: ```bash uv run scripts/generate_video.py ... ``` 3. Because no exact dependency version or verified lockfile is enforced, `uv` resolves and installs the compromised package version. 4. Attacker-controlled initialization or import code executes inside the Skill process. 5. The malicious dependency can read the `RUNWAY_API_KEY` environment variable or `~/tiktok-api.json`, access the supplied image and other files available to the invoking user, and transmit data through the process's available network access. ### Impact Assessment Successful exploitation would provide code execution with the privileges of the user running th ...[truncated 552 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `requests` to a reviewed exact version rather than using an unrestricted package name. 2. Generate and commit a lockfile containing the complete transitive dependency graph. 3. Include and verify cryptographic hashes for downloaded distributions where supported. 4. Execute with locked or frozen dependency resolution so runtime execution fails if the environment differs from the reviewed lockfile. 5. Use a trusted package index and prevent fallback to unapproved indexes. 6. Add automated dependency vulnerability and integrity scanning to release workflows. 7. Periodically update dependencies through a controlled review process rather than resolving arbitrary current versions during normal execution.
