T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:26
- Finding
- Unpinned Python Dependencies and Mutable Model Artifacts## Vulnerability Details **File Location**: `SKILL.md:26`, `SKILL.md:46`, `SKILL.md:102`, `SKILL.md:343-346`, `README.md:20-26`, `USAGE.md:20`, and `USAGE.md:234` **Vulnerability Type**: Supply-chain exposure through unpinned dependencies and model revisions **Risk Level**: Medium ### Vulnerable Code `SKILL.md:26` and `SKILL.md:343`: ```bash pip install sentence-transformers faiss-cpu click flask ``` `README.md:20`: ```bash pip install sentence-transformers faiss-cpu click flask ``` `SKILL.md:46`, `README.md:26`, and `USAGE.md:20`: ```bash python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='sentence-transformers/all-MiniLM-L6-v2', local_dir='./models/all-MiniLM-L6-v2')" ``` `SKILL.md:102`: ```python self.model = SentenceTransformer(self.model_name) ``` `USAGE.md:234`: ```bash python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='sentence-transformers/all-mpnet-base-v2', local_dir='./models/all-mpnet-base-v2')" ``` ### Technical Analysis The installation commands do not pin exact package versions or verify package hashes. Consequently, running the same documented command at different times can install different dependency versions. The model download commands similarly reference mutable Hugging Face repositories without specifying immutable commit revisions or expected artifact checksums. The `SentenceTransformer(self.model_name)` fallback can also retrieve model artifacts implicitly when the expected local model is unavailable. This weakens the documented offline trust boundary and makes runtime behavior depend on externally supplied content. This finding does not establish that the named packages or models are malicious. The vulnerability is the absence of controls that ensure users receive the same reviewed artifacts. ### Attack Path 1. An attacker compromises an upstream package release, model repository, maintainer acco ...[truncated 1169 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every Python dependency to an explicitly reviewed version in a lock file. 2. Generate and enforce cryptographic hashes, such as through `pip install --require-hashes -r requirements.txt`. 3. Use a trusted package index explicitly and apply dependency vulnerability scanning in CI. 4. Pin each Hugging Face download to an immutable commit using the `revision` parameter. 5. Record and verify checksums for all downloaded model files before loading them. 6. Configure runtime loading for local-only operation after verification, for example by using supported `local_files_only` controls. 7. Fail closed when the verified local model is missing instead of silently downloading a replacement. 8. Document the initial network-dependent setup separately from offline runtime behavior.
