T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Installation
- Content
View full analysis
Vulnerability Details
File Locations:
requirements.txt:1-2metadata.json:19-23README.md:17-20SKILL.md:18-30demo_project/README.md:7-10
Vulnerability Type: Dependency supply-chain exposure through unpinned packages
Risk Level: MediumRelevant Code Snippets:
requirements.txt:1-2text vnpy>=3.0.0 vnpy-ctp>=6.0.0metadata.json:19-23json "packages": [ "vnpy>=3.0.0", "vnpy-ctp>=6.0.0" ]README.md:17-20bash pip install vnpy vnpy-ctp vnpy-ctastrategySKILL.md:18-30bash # Install core framework pip install vnpy # Install CTP gateway (futures) pip install vnpy-ctp # Install common components pip install vnpy-ctastrategy # CTA strategy module pip install vnpy-spreadtrading # Spread trading module pip install vnpy-datamanager # Data management module pip install vnpy-sqlite # SQLite database pip install vnpy-rqdata # RQData data servicedemo_project/README.md:7-10bash pip install -r ../requirements.txtTechnical Analysis
The project instructs users to install third-party Python packages without exact version pins or integrity hashes. The constraints in
requirements.txtandmetadata.jsonare lower bounds, meaning that any future version satisfying those bounds may be installed. The directpip installcommands impose no version constraint at all.Consequently, the effective code installed by following the project documentation can change after this project has been reviewed. Python package installation may execute package build hooks, while installed modules execute code when imported or invoked. If a dependency publisher account, package repository, distribution artifact, or future compatible release is compromised, an attacker-controlled package can enter the installation path without requiring any change to this repository.
This findi ...[truncated 1697 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace lower-bound constraints with exact, reviewed versions, for example:
text vnpy==REVIEWED_VERSION vnpy-ctp==REVIEWED_VERSION - Generate a lock file containing all transitive dependencies rather than locking only direct dependencies.
- Record cryptographic hashes for every approved distribution and enforce them with:
bash pip install --require-hashes -r requirements.lock - Update all installation examples to use the reviewed lock file instead of unconstrained
pip installcommands. - Explicitly document the trusted package index and use an index allowlist where the deployment system supports it.
- Install dependencies in an isolated virtual environment or container under a non-privileged account.
- Review dependency updates before changing the lock file, including package provenance, release history, maintainers, build configuration, and vulnerability advisories.
- Use automated dependency scanning and test updated packages in a non-production environment before permitting access to broker credentials or live trading services.
- Replace lower-bound constraints with exact, reviewed versions, for example:
