T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Third-Party Dependencies## Vulnerability Details **File Location**: `requirements.txt`, lines 1–3 **Vulnerability Type**: Supply-chain exposure caused by unpinned dependencies **Risk Level**: Medium ### Vulnerable Code ```text matplotlib numpy pandas ``` Related installation instructions also appear in `SKILL.md`, line 32: ```bash pip install pandas matplotlib numpy scipy ``` ### Technical Analysis The project specifies third-party packages without exact versions or integrity hashes. Consequently, each installation resolves whichever package releases are available from the configured Python package index at that time. This prevents reproducible dependency resolution and means the installed code can change without any modification to the audited project. If a package repository, publisher account, configured package index, or dependency release is compromised, installation could introduce attacker-controlled package code. Python packages may execute code during the build or installation process, and malicious behavior may also trigger when the application imports the package. The documentation additionally instructs users to install `scipy`, although the implementation does not import it and `requirements.txt` does not declare it. This unnecessary dependency expands the supply-chain attack surface and creates inconsistency between the documented and actual environment. ### Attack Path 1. A user follows `SKILL.md` or installs packages from `requirements.txt`. 2. `pip` resolves mutable package versions from the user's configured package index because no versions or hashes are specified. 3. An attacker compromises a relevant publisher, release, index, mirror, or dependency distribution channel. 4. `pip` downloads and installs the attacker-controlled artifact because the project imposes no reviewed-version or integrity constraint. 5. Malicious installation, build, or import-time code executes under the account running `pip` or the plotting script. This path depends on compromise ...[truncated 769 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every direct dependency to an explicitly reviewed version, for example: ```text matplotlib==<reviewed-version> numpy==<reviewed-version> pandas==<reviewed-version> ``` 2. Generate and verify cryptographic hashes for all resolved distributions. Install with a hash-enforcing workflow such as: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Use a lock file or a compiled requirements file that captures reviewed transitive dependencies as well as direct dependencies. 4. Remove `scipy` from `SKILL.md` unless it becomes a genuine runtime requirement, and keep installation documentation synchronized with `requirements.txt`. 5. Install only from a trusted, explicitly configured package index. In controlled environments, mirror approved artifacts into an internal repository. 6. Add automated dependency vulnerability and provenance scanning to the release process. Review and regenerate pins and hashes through a controlled update procedure. 7. Perform installation in an isolated virtual environment or container under a non-privileged account, avoiding system-wide or administrator-level installation.
