T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Releases
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-4
Related Documentation:SKILL.md:310-314
Vulnerability Type: Unpinned dependencies and non-reproducible installation
Risk Level: MediumVulnerable Code
requirements.txt:1-4:text requests>=2.28.0 qrcode>=7.0 Pillow>=9.0.0 packaging>=21.0SKILL.md:310-314:bash pip install requests qrcode PillowTechnical Analysis
The dependency specifications define only minimum versions and do not impose upper bounds, exact versions, or package hashes. Consequently, every installation may resolve to different and potentially unreviewed future releases. The installation command in
SKILL.mdis even less restrictive because it installs the latest versions directly rather than using a reviewed lock file.This does not prove that any current dependency is malicious. The security weakness is that the project has no mechanism to guarantee dependency integrity or reproduce an audited dependency set. If an allowed package release or its publishing account is compromised, installation or import-time behavior could execute attacker-controlled Python code with the privileges of the user running the Skill.
The affected packages are imported by the login workflow, which handles a reusable
PASSPORT_ACCESS_TOKENand stores it under~/.vipshop-user-login/tokens.json. A compromised dependency would therefore execute in a process with access to the Skill's authentication state and other resources available to that operating-system user.Attack Path
- An attacker compromises the publishing account, release infrastructure, or distribution artifact of one of the permitted dependencies.
- The attacker publishes a version satisfying the open-ended
>=constraint. - A user installs the Skill dependencies using
pip install -r requirements.txtor follows the less restrictive `pip install requests qrcode Pillo ...[truncated 1204 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace minimum-version constraints with exact versions that have been reviewed and tested:
text requests==REVIEWED_VERSION qrcode==REVIEWED_VERSION Pillow==REVIEWED_VERSION packaging==REVIEWED_VERSION -
Generate and maintain a lock file containing hashes for every direct and transitive dependency. Install it with hash verification:
bash python -m pip install --require-hashes -r requirements.lock -
Update
SKILL.mdso users install only from the reviewed lock file rather than invoking unconstrained package installation:bash python -m pip install --require-hashes -r requirements.lock -
Use an automated dependency-update process that creates reviewed changes when versions or hashes change. Run vulnerability scanning and regression tests before accepting each update.
-
Configure installation to use the official or an organization-controlled package index, and avoid untrusted extra indexes that could introduce dependency-confusion packages.
-
Run the Skill in a dedicated virtual environment under a non-administrative account to reduce the impact of a compromised dependency.
-
