T08 · Insecure Dependencies
Warning
- Location
references/publish-checklist.md:17- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
=5.4.0,<6` Install: ```bash /usr/bin/python3 -m pip install pypdf ``` ``` ### Technical Analysis The documented installation command installs `pypdf` without enforcing the stated version range, an exact reviewed version, package hashes, or a trusted package index. Consequently, pip resolves whichever compatible package is offered by the user's configured index at installation time. This creates a supply-chain exposure because package resolution may be affected by: - Compromise of the package or distribution infrastructure. - A malicious or untrusted package index configured through pip settings or environment variables. - Future package releases that have not been reviewed by the project. - Changes to package artifacts after the skill itself has been audited. The installed dependency is subsequently imported by `scripts/booklet_merge.py`: ```python from pypdf import PdfReader, PdfWriter, Transformation from pypdf._page import PageObject ``` Importing a compromised package can execute attacker-controlled Python code within the process. ### Attack Path 1. A user follows the installation instructions in `references/publish-checklist.md`. 2. The command invokes pip without an exact version, hash verification, or an explicitly trusted index. 3. The user's pip configuration resolves `pypdf` from a compromised or attacker-controlled source, or resolves an unintended future release. 4. Malicious code may execute during package installation through package build or installation mechanisms. 5. The malicious package is later imported when `scripts/booklet_merge.py` runs, providing another code-execution opportunity. 6. The payload executes with the permissions of the user running pip or the booklet script. ### Impact A ...[truncated 633 chars]- Remediation
View remediation
=5.4.0,<6' ``` This minimum measure does not replace exact version pinning and hash verification. 6. Run dependency installation and PDF processing as an unprivileged user in an isolated virtual environment or container with only the filesystem and network access required for the task. ]]>
