T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Third-Party Dependency Creates a Supply-Chain Risk## Vulnerability Details **File Location**: `requirements.txt:1`; related installation instructions at `SKILL.md:54` and `SKILL.md:78` **Vulnerability Type**: Unpinned and unhashed third-party dependency **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1`: ```text gql[websockets]>=3.4.0 ``` Related installation command in `SKILL.md:78`: ```bash pip install 'gql[websockets]' ``` ### Technical Analysis The project permits any future version of `gql` at or above version 3.4.0 and does not constrain or verify its transitive WebSocket dependencies. No lock file or cryptographic package hashes are provided. The documented direct installation command is even less restrictive because it installs the latest version selected by the package index. Consequently, the code reviewed during this audit may not be the dependency code installed later. A compromised upstream release, dependency-confusion condition, or malicious transitive dependency could introduce attacker-controlled code. Such code could run during package installation where supported or when the dependency is imported by `scripts/stream_stablecoin_payments.py`. ### Attack Path 1. An attacker compromises a future release of `gql` or one of its transitive dependencies, or otherwise influences dependency resolution. 2. A user follows the documented installation command or installs from `requirements.txt`. 3. `pip` resolves and downloads the attacker-controlled package because no exact version or hash validation prevents it. 4. Malicious code executes during installation or when the streaming script imports the affected package. 5. The code runs with the privileges of the user executing `pip` or the streaming script and can access data available to that process, including `BITQUERY_API_KEY`. ### Impact Assessment Exploitation could result in arbitrary code execution under the installing or runtime user's account. The accessible scope may include e ...[truncated 336 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `gql` and all transitive dependencies to versions that have been reviewed and tested. 2. Generate a reproducible lock file with a tool such as `pip-compile`. 3. Record SHA-256 hashes for every permitted distribution and install with: ```bash pip install --require-hashes -r requirements.txt ``` 4. Replace the unconstrained command in `SKILL.md` with installation from the locked, hash-verified requirements file. 5. Use only trusted package indexes and explicitly configure the expected index URL in controlled environments. 6. Run dependency vulnerability and provenance checks in CI, and review dependency updates before regenerating the lock file. 7. Install and run the skill in an isolated virtual environment or container with only the minimum required environment variables and filesystem permissions.
