T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk
- Content
View full analysis
/requirements.txt ``` ### Technical Analysis The dependency specification does not constrain either package to a reviewed version and does not provide cryptographic hashes. Each installation can therefore resolve to whichever compatible releases are available from the configured package index at that time. This makes installation behavior non-reproducible and allows the effective dependency code to change after the Skill has been audited. If an upstream distribution account, package release, package index, or dependency-resolution environment is compromised, a malicious package version could be selected and installed. Python package installation may execute package build or installation logic with the privileges of the user running `pip`. The package names are conventional, and the project does not specify a suspicious package index or download location. This finding is therefore a supply-chain exposure, not evidence that the currently named packages or the project itself are malicious. ### Attack Path 1. An attacker compromises an upstream package publisher, distribution account, package index, or package-delivery path. 2. The attacker publishes or substitutes a malicious release that satisfies the unconstrained dependency declaration. 3. A user follows the installation command documented in `SKILL.md`. 4. `pip` resolves the dependency to the malicious release because no reviewed version or hash is enforced. 5. Malicious installation or runtime code executes under the account running the installation or image-processing script. ### Impact Assessment Successful exploitation could execute arb ...[truncated 482 chars]- Remediation
View remediation
numpy== ``` 2. Generate and record cryptographic hashes for every permitted distribution: ```text opencv-python-headless== --hash=sha256: numpy== --hash=sha256: ``` 3. Require hash verification during installation: ```bash python3 -m pip install --require-hashes -r /requirements.txt ``` 4. Generate the locked dependency set in a controlled environment and account for transitive dependencies and supported platforms. 5. Review dependency updates before changing the lock file, including release provenance, known vulnerabilities, compatibility, and package hashes. 6. Install dependencies in an isolated virtual environment using a non-privileged account rather than performing a system-wide or administrator-level installation. ]]>
