T08 · Insecure Dependencies
Warning
- Location
- scripts/satoshi_api.py:3
- Finding
- Unpinned Runtime Dependency Allows Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `scripts/satoshi_api.py:3-5` **Vulnerability Type**: Unpinned third-party dependency resolved at runtime **Risk Level**: Medium ### Vulnerable Code ```python # /// script # requires-python = ">=3.10" # dependencies = ["httpx"] # /// ``` The documented invocation in `SKILL.md:40-45` uses `uv run`: ```text uv run satoshi_api.py fees uv run satoshi_api.py mempool uv run satoshi_api.py price uv run satoshi_api.py block uv run satoshi_api.py address <address> uv run satoshi_api.py halving ``` ### Technical Analysis The inline dependency declaration specifies `httpx` without an exact version, lockfile, or package hashes. When the documented `uv run` command is executed in an environment where dependencies are not already securely locked and cached, `uv` may resolve and install a currently available `httpx` release and its transitive dependencies. This makes the effective runtime dependency set mutable after the Skill has been reviewed. A compromised upstream release, compromised transitive dependency, or unexpectedly incompatible future release could consequently be introduced without a corresponding change to this repository. The audit found no evidence that the current `httpx` package is malicious and found no dependency-confusion package name. The finding concerns the absence of reproducible, integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises an upstream dependency release or its package-distribution account, or introduces a malicious version through the applicable package-resolution path. 2. A user invokes one of the documented `uv run satoshi_api.py ...` commands. 3. `uv` resolves the unpinned `httpx` requirement and its transitive dependency graph. 4. The compromised package is downloaded and installed or selected for the execution environment. 5. Package code executes when imported or otherwise initialized by the script. 6. The malicious dependency operates with ...[truncated 853 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `httpx` to a reviewed, exact version instead of using an unconstrained requirement: ```python # dependencies = ["httpx==<reviewed-version>"] ``` 2. Generate and commit a lockfile that records the complete transitive dependency graph and exact versions. 3. Require package hash verification or an equivalent integrity mechanism during dependency installation. 4. Configure `uv` to use only trusted package indexes and reject unapproved alternate sources. 5. Update dependencies through a controlled review process that includes vulnerability scanning and inspection of lockfile changes. 6. Run the Skill under a least-privileged account with restricted filesystem, credential, and network access to limit the impact of a compromised dependency. 7. In sensitive or offline deployments, prebuild and verify the environment rather than resolving packages during each Skill invocation. ]]>
