T08 · Insecure Dependencies
- Location
references/custom-oss.md:13- Finding
Unpinned Python Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
references/custom-oss.md:13
Vulnerability Type: Unpinned third-party package installation
Risk Level: MediumVulnerable Code:
bash pip install alibabacloud-oss-v2Technical Analysis
The setup instructions install
alibabacloud-oss-v2without specifying a reviewed version or validating package integrity with cryptographic hashes. Consequently, the installed artifact depends on mutable package-index state at installation time.Python package installation can execute package-controlled build and installation logic. If the package distribution, publishing account, package index, or dependency chain is compromised, following this instruction could execute attacker-controlled code. An unintended future release could also introduce incompatible or vulnerable behavior without any change to the audited skill.
Attack Path
- An attacker compromises the package publisher, distribution channel, or a transitive dependency.
- The attacker publishes a malicious release that satisfies the unrestricted package name.
- A user follows the documented setup command.
pipresolves and downloads the mutable malicious release.- Package-controlled installation logic executes with the privileges of the user running
pip. - The installed package may subsequently execute malicious behavior when imported or used.
Impact Assessment
Successful exploitation could execute arbitrary code with the privileges of the user performing the installation. Depending on that user's access, the malicious package could read project files and environment variables, access configured API or OSS credentials, alter local files, or compromise other resources available to the account.
The project does not direct users to run the command with elevated privileges, so administrator or root access is not inherently obtained. The affected scope is the installation environment and re ...[truncated 40 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to a specifically reviewed version rather than installing an unrestricted latest release.
- Publish a locked requirements file containing exact versions and cryptographic hashes.
- Install with hash enforcement, such as
pip install --require-hashes -r requirements.txt. - Review and lock transitive dependencies as well as the direct dependency.
- Use an isolated virtual environment with only the permissions required for the task.
- Periodically update the lock file through a controlled dependency-review process rather than implicitly accepting new releases.
