T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:44
- Finding
- Unpinned and Overly Broad Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 44-60 **Vulnerability Type**: Unpinned third-party packages and unnecessary development dependencies **Risk Level**: Medium ### Vulnerable Code ```bash ### Minimum install ```bash pip install huggingface_hub ``` ### Recommended install with all extras ```bash pip install "huggingface_hub[cli,torch,tensorflow,fastai,dev]" ``` | Extra | Adds | |-------|------| | `cli` | `huggingface-cli` command | | `hf_transfer` | Fast Rust-based multi-part downloads (`pip install hf_transfer`) | | `torch` | PyTorch model helpers | | `tensorflow` | TensorFlow model helpers | | `fastai` | fastai helpers | ``` The project metadata also declares the dependency without a version constraint: ```yaml install: - kind: pip package: huggingface_hub bins: [huggingface-cli] ``` ### Technical Analysis The installation instructions resolve `huggingface_hub`, `hf_transfer`, and all transitive dependencies from the package index without pinning reviewed versions or verifying package hashes. As a result, the code installed by users can change after the Skill itself has been audited. The recommended command additionally installs the `dev` extra and several large machine-learning framework extras. Development dependencies are not required for normal Hub operations and substantially increase the number of packages, build scripts, native components, and transitive dependencies that must be trusted. Python packages and their build backends may execute code during installation. A compromised upstream release, compromised maintainer account, malicious transitive dependency, or unexpected dependency-resolution change could therefore introduce attacker-controlled code despite no corresponding change to this repository. This finding does not establish that the currently published packages are malicious. The security weakness is the mutable and unnecessarily broad supply-chain trust boundary created by the install ...[truncated 1719 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Pin reviewed dependency versions** - Replace unconstrained package declarations with exact, reviewed versions. - Apply the same constraint in both Skill metadata and installation documentation. - Example: ```bash pip install "huggingface_hub==<reviewed-version>" ``` 2. **Use hash-verified lock files** - Generate a lock or requirements file containing exact versions and cryptographic hashes for all transitive dependencies. - Install with hash enforcement: ```bash pip install --require-hashes -r requirements.txt ``` 3. **Remove development dependencies from normal installation** - Do not recommend the `dev` extra to ordinary users. - Keep testing, linting, and packaging dependencies in a separate development-only lock file. 4. **Separate optional functionality** - Make `torch`, `tensorflow`, `fastai`, CLI support, and transfer acceleration separate opt-in installation profiles. - Document the minimum package set required for each operation. 5. **Review and automate dependency updates** - Review changelogs and provenance before updating pins. - Run vulnerability and license scanning against the complete locked dependency graph. - Update pins through controlled pull requests rather than resolving current releases during installation. 6. **Reduce runtime credential exposure** - Use fine-grained, repository-scoped Hugging Face tokens. - Avoid exposing write-capable tokens to dependency installation processes. - Perform dependency installation in an isolated build stage that does not contain `HF_TOKEN`. ]]>
