T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unbounded Third-Party Dependency Versions Allow Unreviewed Package Releases
- Content
View full analysis
=3.0.0 pandas>=1.5.0 ``` `demo_project/README.md:6-10`: ```markdown 1. Ensure that the dependencies are installed: ```bash pip install -r ../requirements.txt ``` ``` `SKILL.md:15-20`: ```markdown ## Installation ```bash pip install tqsdk ``` ``` ### Technical Analysis The dependency manifest specifies only minimum versions and does not impose upper bounds or exact versions. The primary installation documentation is even less restrictive because it installs `tqsdk` without any version constraint. No lock file or package hashes are supplied to verify the exact artifacts being installed. Consequently, following the documented installation process can install future dependency releases that were not available or reviewed when this Skill was published. Python packages may execute code during installation or when imported. The demo imports `tqsdk`, while the broader Skill expects TqSdk to receive account credentials, connect to external trading services, and submit orders. This does not establish that the current upstream packages are malicious. The vulnerability is the absence of reproducible, integrity-verified dependency resolution, which expands the impact of an upstream package compromise, malicious release, or unexpected incompatible update. ### Attack Path 1. An attacker compromises a dependency publisher account, upstream release process, or package distribution channel for `tqsdk`, `pandas`, or a transitive dependency. 2. The attacker publishes a malicious version satisfying `>=3.0.0` or `>=1.5.0`. 3. A user follows the documented `pip install` command. 4. Pip resolves and installs the malicious or otherwise unreviewed release because no exact vers ...[truncated 1224 chars]- Remediation
View remediation
pandas== ``` 2. Generate and commit a lock file that includes all transitive dependencies. 3. Require cryptographic hashes during installation. For example, generate a fully resolved requirements file using `pip-compile --generate-hashes` and install it with: ```bash pip install --require-hashes -r requirements.lock ``` 4. Configure pip to use an explicitly approved package index and trusted internal mirror where appropriate. Do not add untrusted extra package indexes. 5. Review release notes, source changes, package ownership, and artifact provenance before updating pinned versions. 6. Run dependency installation and the demo in an isolated virtual environment or container under a non-privileged account. 7. Keep production trading credentials out of development and installation environments. Provide them only at runtime through a dedicated secret manager with narrowly scoped access. 8. Add automated dependency scanning and controlled update tooling, but require security review and testing before merging version changes. 9. Update `SKILL.md` and `demo_project/README.md` so all installation examples reference the integrity-verified lock file rather than unconstrained `pip install tqsdk`. ]]>
