T08 · Insecure Dependencies
- Location
SKILL.md:15- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 15–18
Vulnerability Type: Unpinned third-party dependency
Risk Level: Mediummarkdown Install the library: ```bash pip install huggingface_hubtext ### Technical Analysis The installation command retrieves `huggingface_hub` without a version constraint, lockfile, or cryptographic hash verification. Consequently, the installed package and its transitive dependencies may differ from the versions reviewed during this audit. This creates supply-chain exposure because a compromised, malicious, or unexpectedly incompatible future release could execute code during package installation or when `scripts/hf_hub.py` imports the package. The package name itself is legitimate and no current package compromise was established; the finding concerns the mutable and unverified installation process. ### Attack Path 1. An attacker compromises a future release of `huggingface_hub` or one of its transitive dependencies. 2. A user follows the prerequisite command in `SKILL.md`. 3. `pip` resolves and installs the mutable latest package release. 4. Malicious package code executes during installation or when `scripts/hf_hub.py` imports `huggingface_hub`. 5. The code runs with the permissions of the user executing the installation or skill. ### Impact Assessment Successful exploitation could permit arbitrary code execution within the installing user's privilege boundary. Depending on that user's permissions, the malicious dependency could access local files, environment variables such as `HF_TOKEN`, the fallback token file if readable, network resources, and Hugging Face repositories authorized by the token. No privilege escalation beyond the executing user's existing permissions is demonstrated by the audited project.- Remediation
View remediation
Remediation Suggestions
- Pin
huggingface_hubto a reviewed exact version rather than installing an unconstrained latest release. - Record and pin all transitive dependencies in a lockfile.
- Require cryptographic hashes during installation, such as through a hash-locked requirements file and
pip install --require-hashes. - Explicitly use the official Python package index or an organization-controlled package mirror.
- Automate dependency vulnerability and provenance checks before updating pinned versions.
- Review and test dependency upgrades before changing the lockfile.
- Pin
