T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Third-Party Dependencies Create Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-18` **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```text anndata biopython dataclasses gseapy h5py matplotlib mygene numpy pandas plotly pyyaml scanpy scipy scvi-tools seaborn torch tqdm transformers ``` The installation instructions in `SKILL.md:66-74` also recommend additional unpinned packages: ```bash # Basic dependencies pip install torch transformers scanpy scvi-tools # Bioinformatics tools pip install gseapy enrichrpy # Model-specific dependencies pip install geneformer scgpt ``` ### Technical Analysis All declared dependencies lack exact version constraints and integrity hashes. Consequently, installation resolves whichever releases are current at that time rather than a previously reviewed dependency set. The documentation also instructs users to install model-specific packages that are not represented in `requirements.txt`. This creates a supply-chain exposure in which a compromised, malicious, or unexpectedly incompatible future release can be installed without any repository change. Python packages may execute code during installation and later during import with the privileges of the user running `pip` or the application. The broad dependency list also increases the attack surface. Several packages are not imported by the current implementation, meaning users may install unnecessary components with their own transitive dependency trees. ### Attack Path 1. An attacker compromises an existing dependency, one of its transitive dependencies, or a future package release. 2. The attacker publishes a malicious version under a package name allowed by the unpinned manifest or installation instructions. 3. A user follows `SKILL.md` or runs `pip install -r requirements.txt`. 4. The package resolver selects the malicious release because no reviewed version or hash is required. 5. Malicious installation hooks or imported ...[truncated 878 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to an exact, reviewed version, for example: ```text numpy==2.1.3 pandas==2.2.3 ``` 2. Generate and commit a lock file containing the complete transitive dependency graph. 3. Require package hashes during installation, such as through a hash-locked requirements file and: ```bash pip install --require-hashes -r requirements.lock ``` 4. Move all packages required by the documented installation process into one authoritative dependency manifest. 5. Remove packages that are not used by the current implementation. 6. Run dependency vulnerability and provenance checks in CI. 7. Install dependencies in an isolated, unprivileged virtual environment or container. 8. Review dependency updates before regenerating the lock file rather than accepting updates automatically. ]]>
