T08 · Insecure Dependencies
Warning
- Location
- README.md:51
- Finding
- Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `README.md:51` **Vulnerability Type**: Unpinned third-party package installation **Risk Level**: Medium ```bash pip install jieba ``` The same unpinned installation guidance is also presented by `quickstart.py:209`. ### Technical Analysis The installation command does not specify a reviewed package version or an integrity hash. Consequently, the package resolved and installed depends on the configured Python package index and the latest release available at installation time. This produces non-reproducible environments and creates a supply-chain exposure if the package source, maintainer account, release process, or configured index is compromised. This finding does not establish that the current `jieba` package is malicious. The risk arises because the instructions implicitly trust a mutable future package release without verifying its exact version or contents. ### Attack Path 1. An attacker compromises the package publisher, distribution account, upstream release process, or package index used by the victim. 2. The attacker publishes or substitutes a malicious package release under the expected package name. 3. A user follows the documented `pip install jieba` instruction. 4. `pip` resolves the attacker-controlled release because no version or hash constraint is present. 5. Malicious installation-time or import-time Python code executes in the user's environment. ### Impact Assessment Malicious dependency code could execute with the privileges of the user or automation account running `pip` or importing the package. Depending on those privileges, the compromise could affect project files, accessible credentials, local data, build outputs, and other resources available to that account. In privileged or CI/CD environments, the scope could extend to deployment credentials and generated artifacts. The dependency is documented as optional, and the app ...[truncated 164 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `jieba` to a specifically reviewed version rather than installing the latest available release. 2. Record dependencies in a lock file or requirements file and require verified SHA-256 hashes, such as through `pip install --require-hashes`. 3. Install packages only from an explicitly approved package index. 4. Review dependency updates before changing the pinned version, including package ownership, release provenance, and published artifacts. 5. Run dependency installation with least privilege inside an isolated virtual environment or container. 6. Update both `README.md` and `quickstart.py` so all installation guidance uses the same pinned and verified dependency specification. 7. Continue documenting the dependency-free fallback so users can avoid installing the optional package when enhanced Chinese segmentation is unnecessary.
