T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:100
- Finding
- Unpinned Third-Party Package Is Installed and Executed Without Integrity Verification## Vulnerability Details **File Location**: `SKILL.md`, lines 100-103; execution entry point in `scripts/Start_QuantAll.py`, lines 1-3 **Vulnerability Type**: Supply-chain exposure through an unpinned dependency and package mirror **Risk Level**: Medium ### Vulnerable Code From `SKILL.md`: ```text □ 2. pip installation: <skill-dir>/scripts/.venv/Scripts/python.exe -m pip install quantall -i https://pypi.tuna.tsinghua.edu.cn/simple □ 3. Create Start_QuantAll.py in the scripts directory: import os from QuantAll import Start_main Start_main(os.path.dirname(__file__)) ``` Corresponding code in `scripts/Start_QuantAll.py`: ```python import os from QuantAll import Start_main Start_main(os.path.dirname(__file__)) ``` ### Technical Analysis The installation command retrieves the latest package matching the name `quantall` from a third-party package mirror. It does not specify an exact version, validate package hashes, use a reviewed lockfile, or otherwise authenticate the expected artifact. The installed package is then imported and its `Start_main` entry point is invoked. Python packages can execute code during installation, module import, and function invocation. Consequently, the effective executable code is mutable after this Skill has been audited. QuantAll is a declared functional dependency, so installing it is not inherently unauthorized. The vulnerability is the absence of supply-chain controls around installation and execution. The Skill itself does not contain evidence that the package or mirror is currently malicious. ### Attack Path 1. An attacker compromises the `quantall` package release, one of its transitive dependencies, the configured mirror, or the relevant publisher account. 2. The attacker publishes or serves a malicious package version under the expected package name. 3. A user follows the documented unpinned `pip install quantall` command. 4. Pip selects the att ...[truncated 1135 chars]
- Remediation
- ## Remediation Suggestions 1. Pin QuantAll to a specifically reviewed version: ```text python -m pip install "quantall==<approved-version>" ``` 2. Generate and distribute a requirements or lock file containing hashes: ```text quantall==<approved-version> \ --hash=sha256:<verified-package-hash> ``` Install it with: ```text python -m pip install --require-hashes -r requirements.txt ``` 3. Pin and hash all transitive dependencies, not only the top-level package. 4. Document the authoritative publisher, package index, expected version, and checksum. Use the authoritative index unless a mirror is operationally necessary. 5. If a mirror is required, use a trusted synchronized mirror and verify downloaded artifacts against independently published hashes or signatures. 6. Run the engine inside a dedicated virtual environment under a non-administrative account with access restricted to the required scripts, output directory, and market database. 7. Review release changes before updating the pinned version, and perform dependency scanning or software-composition analysis as part of the update process. 8. Avoid silently upgrading the dependency. Treat each version change as a separately reviewed deployment.
