T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Python Dependencies Allow Mutable Supply-Chain Code## Vulnerability Details **File Location**: `requirements.txt:1-7`; installation command in `SKILL.md:25` **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Medium **Vulnerable Code Snippet**: ```text pysolar matplotlib pytz shapely numpy psychrolib rasterio ``` The dependencies are installed through the following documented command: ```bash pip install -r requirements.txt ``` ### Technical Analysis All Python dependencies are specified without exact versions or integrity hashes. Consequently, each installation can resolve to different and mutable package releases. Python package installation may execute package build logic, backend hooks, or other code with the privileges of the user performing the installation. If a package maintainer account, package release, distribution artifact, or transitive dependency is compromised, following the documented setup procedure could install attacker-controlled code. The absence of hashes also prevents `pip` from verifying that downloaded artifacts are the exact artifacts reviewed and approved by the project. `psychrolib` was not imported by any of the audited scripts, so it appears unnecessary for the observed runtime behavior and increases the dependency attack surface without a demonstrated functional requirement. ### Attack Path 1. An attacker compromises an upstream dependency, its publishing account, or one of its transitive dependencies. 2. The attacker publishes a malicious release under the legitimate package name. 3. A user follows `SKILL.md` and runs `pip install -r requirements.txt`. 4. Because no versions or hashes are pinned, `pip` may select the malicious release. 5. Attacker-controlled installation or runtime code executes in the user's Python environment. 6. The malicious dependency can act with the privileges and filesystem/network access of the installing user or of later skill executions. ### Impact Assessment S ...[truncated 447 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every direct dependency to an explicitly reviewed version using exact `==` constraints. 2. Generate a lock file that includes all transitive dependencies. 3. Record cryptographic hashes for every accepted distribution and install with `pip --require-hashes`. 4. Prefer reviewed binary wheels from trusted package indexes and restrict alternate indexes to prevent dependency-confusion attacks. 5. Remove `psychrolib` unless a documented and tested feature requires it. 6. Install dependencies in an isolated virtual environment using a non-privileged account. 7. Add automated dependency vulnerability and provenance checks to the release process. 8. Periodically update dependencies through a controlled review and testing workflow rather than resolving unrestricted latest releases during end-user installation.
