T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unbounded Third-Party Dependency Versions Expand the Supply-Chain Attack Surface
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt, lines 1-2
Vulnerability Type: Unbounded dependency resolution
Risk Level: MediumAffected Code:
text pytest>=7.0.0 pyyaml>=6.0The affected installation command is documented in
README.md, line 27:bash pip install -r requirements.txtTechnical Analysis
Both dependencies specify only minimum versions. Consequently, package installation may resolve to any future release accepted by the package index rather than to a version that the project maintainers reviewed and tested.
If a future release, package-index account, distribution channel, or dependency in the resolved graph is compromised, users following the documented installation procedure could receive attacker-controlled package code. Python packages and their transitive dependencies may execute code during build or installation and later when imported.
The exposure is unnecessarily broad because
pytestis used only by the test suite but is included in the general requirements file. PyYAML is a runtime dependency forgenerator.py, where YAML output importsyaml, despiteSKILL.mdclaiming that the project uses only the standard library.This finding does not establish that the currently available PyPI releases are malicious. The vulnerability is the absence of reproducible, reviewed dependency constraints and integrity verification.
Attack Path
- An attacker compromises a permitted future release of
pytest,PyYAML, or a resolved transitive dependency, or compromises its package distribution account. - The attacker publishes a release whose version satisfies the open-ended
>=constraint. - A user follows the documented command,
pip install -r requirements.txt. - pip selects and downloads the compromised release because no exact version, lock file, or cryptographic hash restricts resolution.
- Attacker-controlled package code ...[truncated 720 chars]
- An attacker compromises a permitted future release of
- Remediation
View remediation
Remediation Suggestions
- Pin reviewed dependency versions exactly instead of using open-ended lower bounds.
- Generate and commit a reproducible lock file covering transitive dependencies.
- Use hash verification, such as pip's
--require-hashes, to validate downloaded distributions. - Separate runtime and development dependencies:
- Keep PyYAML in the runtime dependency set only if YAML output remains supported.
- Move pytest to a development or test requirements file.
- Use automated dependency scanning and controlled update reviews before accepting newer releases.
- Install dependencies in an isolated virtual environment or unprivileged CI container rather than with administrative privileges.
- Correct
SKILL.mdso that it accurately discloses the PyYAML dependency.
