T08 · Insecure Dependencies
- Location
install.sh:47- Finding
Unbounded Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
install.sh:47-49andscripts/requirements.txt:1-4
Vulnerability Type: Unpinned and unhashed third-party dependencies
Risk Level: MediumVulnerable Code
install.sh:47-49:bash # Install dependencies echo "Installing dependencies..." "$PIP" install --no-user -q -r "$REQ_FILE"scripts/requirements.txt:1-4:text tvscreener>=0.2.0 pandas>=2.0.0 pyyaml>=6.0 pytest>=7.0.0Technical Analysis
The documented installation process installs packages directly from pip's configured package index. Every dependency uses an open-ended lower-bound constraint, and the project provides neither a lockfile nor cryptographic package hashes.
Consequently, installation results can change over time without any change to the reviewed project. Pip may select any future release satisfying these constraints. If an allowed package release or configured package source is compromised, attacker-controlled package code could run during installation or when the installed module is subsequently imported.
The runtime environment also installs
pytest, although it is only required for testing. This unnecessarily increases the production dependency footprint and supply-chain attack surface.No evidence in the audited project indicates that its authors intentionally introduced a malicious dependency. The risk arises from the non-reproducible and unauthenticated-by-project dependency resolution policy.
Attack Path
- An attacker compromises the publisher account, distribution infrastructure, or package-index delivery path for one of the allowed dependencies.
- The attacker publishes or serves a malicious version whose number satisfies the applicable
>=constraint. - A user follows the documented setup procedure and executes
install.sh. - Pip resolves the malicious version because no exact version or expected hash restricts package selection.
- Attacker-controlled code executes during package instal ...[truncated 790 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace lower-bound constraints with exact, reviewed versions for all runtime dependencies.
- Generate and commit a reproducible lockfile appropriate to every supported platform and Python version.
- Record cryptographic hashes for approved distributions and install with pip's
--require-hashesoption. - Separate runtime and development dependencies so
pytestis not installed in production environments. - Use a controlled package index or repository mirror with provenance, access control, and package-retention policies.
- Add automated dependency vulnerability scanning and require review before updating locked versions.
- Consider using a constraints file and deployment command similar to:
bash "$PIP" install --no-user --require-hashes -r requirements.lock- Rebuild and test lockfiles regularly so security updates are adopted deliberately rather than through unrestricted version resolution.
