T08 · Insecure Dependencies
- Location
compliance.md:103- Finding
Unpinned Third-Party Packages and Model Artifacts
- Content
View full analysis
Vulnerability Details
File Location:
compliance.md:103-110
Vulnerability Type: Supply-chain integrity weakness caused by unpinned dependencies and model revisions
Risk Level: MediumVulnerable Code:
bash # Pre-download everything pip download torch transformers unsloth -d ./packages/ huggingface-cli download meta-llama/Llama-3.1-8B --local-dir ./models/ # Transfer to air-gapped system # Install from local pip install --no-index --find-links=./packages/ torch transformers unslothTechnical Analysis
The documented commands download packages without exact version constraints, cryptographic hashes, or an approved package index. The Hugging Face model is also downloaded without pinning an immutable commit revision.
Consequently, the artifacts transferred into the air-gapped environment depend on whichever package versions and model revision are resolved at download time. The use of
--no-indexduring installation only prevents network access on the destination system; it does not verify the provenance or integrity of artifacts previously placed in./packages/.Python packages may execute installation or import-time code. Model repositories can also contain configuration or custom modeling code, depending on how downstream loading is configured. A compromised upstream release, account, package source, or mutable model repository could therefore introduce altered content into an otherwise trusted environment.
Attack Path
- An upstream package release, package-distribution account, dependency, or model repository is compromised or publishes a malicious revision.
- An operator runs the documented unpinned download commands.
- Dependency resolution retrieves the compromised or unintended latest artifacts.
- The operator transfers those artifacts to the air-gapped system under the assumption that they are trusted.
- The packages are installed locally, or the model is subsequent ...[truncated 932 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin every direct and transitive Python dependency to an exact reviewed version.
- Generate a locked requirements file containing SHA-256 hashes and install with
pip install --require-hashes. - Specify an explicitly approved package index during acquisition and disable unapproved extra indexes.
- Pin the Hugging Face model to an immutable commit using the appropriate revision option.
- Produce a signed artifact manifest containing filenames, versions, origins, licenses, and cryptographic hashes.
- Verify the manifest before transfer and again inside the air-gapped environment.
- Scan packages and model files for malware and known vulnerabilities before approval.
- Avoid loading remote custom model code unless it has been separately reviewed and pinned.
- Perform installation and training inside a non-privileged, network-restricted container or virtual environment.
