T08 · Insecure Dependencies
- Location
SKILL.md:70- Finding
Unpinned Third-Party Dependencies Permit Supply-Chain Substitution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 70-74
Vulnerability Type: Unpinned and integrity-unverified Python dependencies
Risk Level: MediumVulnerable Code
markdown Install dependencies: ```bash pip install Pillow reportlabtext ### Technical Analysis The installation instructions request `Pillow` and `reportlab` without fixed versions or cryptographic hashes. Consequently, pip resolves mutable package versions using the package indexes configured in the user's environment. This does not establish that either named package is currently malicious. However, it leaves dependency selection and integrity outside the reviewed project. A compromised package release, compromised package index, malicious index mirror, or unsafe pip configuration could cause the user to install code that was not included in this audit. Python package installation may execute package build logic. Installed dependencies are also imported by `scripts/generate_photo_book.py`, meaning malicious dependency code could execute when the generator runs even if it did not execute during installation. ### Attack Path 1. An attacker compromises a permitted package release, package-index account, configured mirror, or another source used by pip. 2. The user follows the documented command `pip install Pillow reportlab`. 3. Because versions and hashes are not pinned, pip accepts the dependency artifacts selected by the configured index without validating them against project-approved hashes. 4. Attacker-controlled code executes during package installation or when the script imports `PIL` or `reportlab`. 5. The malicious dependency operates with the privileges of the user running pip or the photo-book generator and can access resources available to that account. This exploitation path requires compromise or attacker influence over dependency distribution or the user's pip configuration; the audited project does not itself retrieve a known malicious package. ...[truncated 684 chars]- Remediation
View remediation
Remediation Suggestions
- Create a reviewed dependency lock file containing exact versions, including all transitive dependencies.
- Generate and record SHA-256 hashes for every approved distribution artifact.
- Install dependencies with hash enforcement, for example:
bash python -m pip install --require-hashes -r requirements.txt - Prefer binary wheels from a trusted package index where appropriate, and explicitly configure the approved index rather than relying on arbitrary local pip configuration.
- Install dependencies in a dedicated virtual environment under an unprivileged user account.
- Add an automated dependency-review process to monitor pinned versions for known vulnerabilities and update the lock file through a controlled review.
- Document that users should not run dependency installation or the generator as root or administrator.
