T08 · Insecure Dependencies
- Location
references/requirements.txt:4- Finding
Mutable Python Dependencies Installed Without Integrity Verification
- Content
View full analysis
Vulnerability Details
File Location:
references/requirements.txt:4-23
Vulnerability Type: Uncontrolled third-party dependency resolution
Risk Level: MediumVulnerable Code
text PyPDF2>=3.0.0 pdfminer.six>=20221105 python-docx>=1.0.0 markdown>=3.5.0 pandoc>=2.3 jieba>=0.42.1 opencc-python>=0.1.7 pytesseract>=0.3.10 pdf2image>=1.16.3The file instructs users to install these dependencies with
pip install -r requirements.txt, but every package is specified using an open-ended minimum version.Technical Analysis
The dependency manifest does not pin exact versions and does not provide package hashes, a lockfile, an approved package index, or signature-verification requirements. Consequently, the effective code installed by the documented command can change without any modification to this skill.
The use of
>=allows pip to select any later compatible package release. If an upstream account, release process, package index, or dependency is compromised, users may automatically install an attacker-controlled release. Python packages can execute code during installation or when imported by document-processing components.This finding does not establish that any currently listed package is malicious. The vulnerability is the absence of controls that would make dependency resolution reproducible and resistant to supply-chain compromise.
Attack Path
- An attacker compromises an upstream package publisher, package release, or package-index distribution channel.
- The attacker publishes a malicious version satisfying one of the open-ended constraints.
- A user follows the documented installation process and runs
pip install -r requirements.txt. - Pip resolves the attacker-controlled release because no exact version or hash restricts the selected artifact.
- Malicious package code executes during installation or when the package is imported.
- The malicious compo ...[truncated 927 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace all open-ended constraints with exact, reviewed versions.
- Generate and commit a reproducible lockfile containing all transitive dependencies.
- Record SHA-256 hashes for every permitted distribution and install with
pip install --require-hashes. - Restrict installation to an approved package index or internal mirror using explicit index configuration.
- Prefer immutable wheel artifacts and disallow unexpected source builds.
- Scan locked dependencies for known vulnerabilities and review publisher or ownership changes.
- Test dependency upgrades in an isolated environment before updating the lockfile.
- Install and run document-processing dependencies in a sandboxed environment with access limited to the required input and output directories.
