T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned and Unverified Remote Python Dependency
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt, lines 1-2
Vulnerability Type: Software supply-chain exposure through an unpinned package and an unverified remote wheel
Risk Level: Hightext pinyin-box>=1.0.0 https://github.com/yanglinzhen/pinyin-box/releases/download/v1.0.0/pinyin_box-1.0.0-py3-none-any.whlTechnical Analysis
The dependency file permits any version of
pinyin-boxat or above version 1.0.0 while also installing a wheel directly from a GitHub release. Neither dependency is protected by a cryptographic hash. The project consequently relies on executable package content fetched from external package infrastructure without verifying that the downloaded artifacts match reviewed versions.Python package installation can execute package installation or build logic, and the installed CLI subsequently executes package code at runtime. The broad version constraint allows a later PyPI release to be selected. The direct URL also depends on the continued integrity of the external repository, release asset, repository owner account, and delivery infrastructure.
The package implementation is not included in the audited project, so its behavior could not be independently reviewed. Listing the same distribution through two different requirement forms also creates avoidable provenance and dependency-resolution ambiguity.
Attack Path
- An attacker compromises the relevant PyPI publisher account, GitHub account, repository, release asset, or another dependency in the package graph.
- The attacker publishes or substitutes a malicious package version accepted by
pinyin-box>=1.0.0, or modifies the externally hosted wheel. - A user follows the installation instructions and runs
pip install -r requirements.txt. - Pip downloads the attacker-controlled artifact because no approved hash is enforced.
- Malicious package logic executes during installation, import, or later invocati ...[truncated 561 chars]
- Remediation
View remediation
Remediation Suggestions
- Select one approved package source rather than declaring the same distribution through both a broad package constraint and a direct URL.
- Pin every direct and transitive dependency to an exact reviewed version.
- Generate and enforce cryptographic hashes using a lock file or
pip install --require-hashes. - Prefer an internally mirrored or vendored artifact whose source and build process have been reviewed.
- Verify release signatures or attestations where the publisher provides them.
- Install the package in a dedicated virtual environment or sandbox under a non-privileged account.
- Add automated dependency scanning and require review before updating the lock file or artifact hashes.
