T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned and inconsistent third-party dependencies create supply-chain risk
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-9;references/requirements.txt:1-23;SKILL.md:220-227, 294;scripts/main.py:634
Vulnerability Type: Unpinned dependencies, mutable source dependencies, and package-name inconsistency
Risk Level: MediumVulnerable Code
requirements.txt:1-9:text bbknn harmonypy matplotlib numpy pandas scanorama scanpy scvi seabornreferences/requirements.txt:1-23:text scanpy>=1.9.0 anndata>=0.9.0 numpy>=1.24.0 pandas>=2.0.0 matplotlib>=3.7.0 seaborn>=0.12.0 leidenalg>=0.10.0 python-igraph>=0.10.0 # Optional: Batch correction harmonypy>=0.0.6 scanorama>=1.7.3 scvi-tools>=1.0.0 bbknn>=1.6.0 # Optional: Advanced analysis cellchatpy>=0.1.0 scvelo>=0.3.0 scikit-misc>=0.3.0 # Optional: Spatial transcriptomics squidpy>=1.3.0 spatialdata>=0.0.14SKILL.md:220-227:r remotes::install_github("satijalab/seurat-wrappers") remotes::install_github("immunogenomics/harmony") BiocManager::install("SingleR")bash pip install scanpy leidenalg scvi-tools cellchatpySKILL.md:294:bash pip install -r requirements.txtscripts/main.py:634:bash pip install scanpy leidenalg python-igraphTechnical Analysis
The root dependency file contains no version constraints or integrity hashes. The reference dependency file specifies only lower bounds, so future and potentially incompatible releases remain eligible for installation. The generated documentation similarly directs users to install packages without pinning versions or verifying package artifacts.
The root file requests the distribution named
scvi, while the documentation and reference requirements requestscvi-tools. The generated Scanpy template imports the Python modulescvi, but an import-module name does not establish that the corresponding package distribution should also ...[truncated 2290 chars]- Remediation
View remediation
Remediation Suggestions
- Replace the root
scvidependency with the intended and verified distribution, presumed from the other project files to bescvi-tools. - Consolidate the root and reference requirement files into one authoritative dependency specification to prevent package-name and version drift.
- Pin every direct dependency to an exact reviewed version, for example
package==x.y.z. - Generate and enforce cryptographic hashes using a lock-file workflow such as
pip-toolswithpip install --require-hashes. - Lock transitive dependencies as well as direct dependencies and regenerate the lock file only through a reviewed update process.
- Pin GitHub dependencies to reviewed immutable commit SHAs, for example
owner/repository@COMMIT_SHA, rather than mutable default branches. - Separate optional analysis dependencies from the default installation set and install them only when the corresponding feature is requested.
- Add automated dependency scanning and package-origin verification to CI.
- Recommend installation in an unprivileged, isolated virtual environment or container and explicitly discourage system-wide or administrative installation.
- Test the locked dependency set to confirm that
import scviis provided by the selectedscvi-toolsdistribution and that generated templates remain compatible.
- Replace the root
