T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned PyYAML Dependency Permits Unreviewed Supply-Chain Updates
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1
Additional Location:README.md:14-16
Vulnerability Type: Unpinned third-party dependency
Risk Level: MediumVulnerable dependency declaration:
text pyyaml>=6.0Related installation instructions:
bash pip install pyyamlTechnical Analysis
The dependency constraint accepts any PyYAML release at or above version 6.0, while the documentation installs the latest release available from the configured package index. Neither installation method specifies an exact reviewed version or verifies distribution integrity with cryptographic hashes.
Consequently, dependency resolution is not reproducible and may install code that was never reviewed with this project. If a future PyYAML distribution or the package source used by
pipis compromised or substituted, package-controlled build or installation logic could execute during installation. The project does not contain evidence of intentional exploitation, malicious dependency naming, or an unsafe custom package index; this finding concerns the uncontrolled dependency resolution policy.Attack Path
- An attacker compromises a future permitted PyYAML release, its distribution artifacts, or the package index configured in the victim's environment.
- A user installs dependencies using
pip install -r requirements.txtor follows the documentedpip install pyyamlcommand. pipresolves and downloads the attacker-controlled distribution because no exact version or integrity hash is required.- Malicious package build or installation behavior executes under the privileges of the user running
pip. - The installed dependency may subsequently execute malicious behavior when imported by
scripts/json_formatter.py.
Impact Assessment
Successful exploitation could execute arbitrary code with the privileges of the account or build environment installing or ...[truncated 470 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin PyYAML to an exact, reviewed version, for example:
text PyYAML==REVIEWED_VERSION - Generate and require cryptographic hashes for all accepted distributions:
bash python -m pip install --require-hashes -r requirements.txt - Maintain the pinned dependency through a controlled update process that includes vulnerability scanning, release-note review, and automated tests.
- Document use of an approved package index and configure CI/CD environments to reject unexpected or untrusted indexes.
- Update
README.mdso its installation command uses the same pinned, hash-verified dependency specification rather than installing the latest available release. - Install dependencies in an isolated virtual environment or container under a non-privileged account to limit the impact of a compromised package.
- Pin PyYAML to an exact, reviewed version, for example:
