T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Automatic Installation of Unpinned Dependencies from a Third-Party Package Mirror
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-4;scripts/pipeline.py:54-63
Vulnerability Type: Software supply-chain risk caused by mutable dependency constraints, automatic installation, and lack of artifact verification
Risk Level: MediumVulnerable Code
text # requirements.txt:1-4 faster-whisper>=1.0.0 easyocr>=1.7.0 imageio-ffmpeg>=0.4.9 yt-dlp>=2024.0.0python # scripts/pipeline.py:54-63 # Upgrade pip print("[setup] 升级 pip ...") run([str(venv_python), "-m", "pip", "install", "--upgrade", "pip", "-i", "https://pypi.tuna.tsinghua.edu.cn/simple"]) # Install dependencies through the Tsinghua mirror req_file = SKILL_DIR / "requirements.txt" print("[setup] 安装依赖(清华源)...") r = run([str(venv_python), "-m", "pip", "install", "-r", str(req_file), "-i", "https://pypi.tuna.tsinghua.edu.cn/simple"])Technical Analysis
The first pipeline execution automatically upgrades
pipand installs all runtime dependencies. Every dependency uses a lower-bound constraint rather than an exact version, so the effective code installed can change without any modification to the audited project.The installation process also lacks a hash-locked requirements file or equivalent artifact integrity validation. Consequently, package selection and integrity depend on the current contents of the configured third-party mirror and on transitive dependency resolution at installation time.
This is a supply-chain weakness rather than evidence that the currently named packages are malicious. Exploitation requires compromise of an upstream package, a dependency, the configured mirror, or a subsequently published version accepted by the broad constraints.
Attack Path
- An attacker compromises a permitted package release, one of its transitive dependencies, or the configured package mirror.
- The attacker publishes or serves a malicious version satisfying the applicable
>=constraint. - A user launches the pipeline outs ...[truncated 698 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin every direct dependency to a reviewed exact version.
- Generate a lock file that also fixes transitive dependency versions.
- Require cryptographic hashes for downloaded distributions, such as with
pip --require-hashes. - Prefer the canonical package index or an organization-controlled repository that synchronizes and verifies approved artifacts.
- Avoid automatic dependency installation during normal processing. Provide a separate, explicit setup command and obtain user approval before changing the environment.
- Pin the installer version instead of automatically upgrading
pipto an uncontrolled latest release. - Add automated vulnerability and provenance checks for both direct and transitive dependencies.
- Rebuild and review the lock file through a controlled update process.
