T08 · Insecure Dependencies
- Location
README.md:80- Finding
Unpinned Third-Party Repositories and Dependencies Create a Supply-Chain Execution Risk
- Content
View full analysis
=2.0.0 torchvision>=0.15.0 transformers>=4.30.0 tensorflow>=2.12.0 tf_keras>=2.12.0 Pillow>=10.0.0 requests>=2.25.0 numpy>=1.23.0 matplotlib>=3.7.0 tqdm>=4.65.0 ``` From `SKILL.md:309`: ```text Required packages (install via `pip install -r requirements.txt`): `torch>=2.0.0`, `torchvision>=0.15.0`, `transformers>=4.30.0`, `tensorflow>=2.12.0`, `tf_keras>=2.12.0`, `pillow>=10.0.0`, `numpy>=1.23.0` ``` ### Technical Analysis The documented installation process clones the current default branches of two external GitHub repositories and immediately executes their dependency installation instructions. No repository commit hashes, signed release tags, package hashes, or integrity checks are specified. Consequently, the code and dependency definitions installed by users can change a ...[truncated 2540 chars]- Remediation
View remediation
``` 2. Replace lower-bound-only package constraints with a tested lockfile containing exact versions and cryptographic hashes. Install with hash enforcement: ```bash pip install --require-hashes -r requirements.lock ``` 3. Use a dependency-locking workflow such as `pip-tools`, Poetry, or another reproducible resolver. Review and regenerate the lockfile through a controlled update process. 4. Remove dependencies not used by the audited scripts, particularly `requests`, `matplotlib`, and `tqdm`, unless a documented runtime feature requires them. 5. Publish SHA-256 checksums for every model file and verify each checksum before loading the model: ```bash echo " mobilenet_weights.h5" | sha256sum --check ``` 6. Prefer signed, immutable upstream releases and verify signatures where available. 7. Install dependencies inside a dedicated virtual environment or container as a non-privileged user. Documentation should explicitly discourage running `pip` with administrator or root privileges. 8. Add automated dependency review, vulnerability scanning, and provenance checks to the release process. 9. Correct the model documentation mismatch: the README downloads a ResNet `.pth` file, while the runtime NIMA implementation expects `weights/mobilenet_weights.h5`. Document and checksum the exact artifact consumed by the code. ]]>
