T08 · Insecure Dependencies
Warning
- Location
- scripts/recraft.py:2
- Finding
- Unbounded Runtime Dependency Resolution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/recraft.py`, lines 2–6 **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium ### Complete Code Snippet ```python # /// script # requires-python = ">=3.10" # dependencies = [ # "requests>=2.31.0", # ] ``` ### Technical Analysis The script declares `requests` using only a minimum version constraint. There is no exact version, lockfile, or package-integrity hash in the reviewed project. Consequently, `uv run` may resolve and install a future package release that was not included in this audit. This creates a mutable supply-chain boundary: the effective code executed by the Skill can change even when the Skill itself remains unchanged. Python package installation and import mechanisms can execute package-controlled code in the context of the current user. The dependency is retrieved from the normal package ecosystem rather than an obviously malicious source, and no dependency confusion or typosquatting was observed. Nevertheless, unrestricted future dependency resolution introduces avoidable risk. ### Attack Path 1. An attacker compromises an allowed future release of the `requests` package or its distribution channel. 2. A user invokes one of the documented `uv run` commands. 3. `uv` resolves the compromised release because it satisfies `requests>=2.31.0`. 4. The package is installed and imported by `scripts/recraft.py`. 5. Package-controlled code executes with the privileges and environment of the user running the Skill. ### Impact Assessment Successful exploitation could provide code execution under the Agent user's account. The compromised dependency could access: - The `RECRAFT_API_TOKEN` environment variable. - Images and other files readable by the running user. - Prompts and image data processed by the Skill. - Network resources accessible from the host. - Files and directories writable by the running user. This does not directly grant administrator privil ...[truncated 72 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `requests` to an audited exact version rather than using a lower-bound-only constraint. 2. Commit and enforce a lockfile that records the complete dependency graph. 3. Require cryptographic hashes for downloaded packages where the tooling supports them. 4. Use a trusted, explicitly configured package index. 5. Perform automated dependency vulnerability and integrity scanning. 6. Review and deliberately update pinned dependencies instead of resolving unrestricted future versions during execution. For example: ```python # dependencies = [ # "requests==<audited-version>", # ] ``` The exact version should be selected based on current security advisories and validated compatibility. ]]>
