T08 · Insecure Dependencies
- Location
SKILL.md:192- Finding
Unpinned Third-Party Python Dependencies
- Content
View full analysis
` (install python-pptx if needed: `pip install python-pptx`) ``` `html-template.md:259`: ```markdown **Dependency:** `pip install Pillow` ``` `scripts/extract-pptx.py:9`: ```python Requires: pip install python-pptx ``` ### Technical Analysis The skill directs the agent or user to install `python-pptx` and `Pillow` without specifying exact versions, package hashes, a lockfile, an approved package index, or other integrity controls. Consequently, the installed code depends on whichever package release and index configuration are active at execution time. This creates a supply-chain risk because the effective dependency code can change after the skill has been reviewed. A compromised package maintainer account, malicious future release, compromised package index, or attacker-controlled index configured through pip settings could cause an unsafe package to be installed. The risk is particularly relevant to `python-pptx`, because `scripts/extract-pptx.py` imports the package immediately: ```python from pptx import Presentation ``` Imported third-party modules execute initialization code with the privileges of the Python process. Pillow is likewise imported by the documented image-processing workflow. No evidence indicates that the currently named packages are malicious; the vulnerability is the absence of reproducible dependency and integrity controls. ### Attack Path 1. An attacker compromises a referenced package release, its publisher account, or a Python package index used by the environment. 2. The user requests PPTX conversion or image processing. 3. Follo ...[truncated 1205 chars]- Remediation
View remediation
Pillow== ``` 2. Record cryptographic hashes for every permitted distribution and require verification: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Use an approved, explicitly configured package index rather than relying silently on the environment's active pip configuration. 4. Install dependencies in a dedicated virtual environment with no elevated privileges: ```bash python -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.txt ``` 5. Review and update pinned versions through a controlled dependency-update process that includes vulnerability scanning and package provenance checks. 6. Replace all inline `pip install python-pptx` and `pip install Pillow` instructions with references to the verified requirements file. 7. Document the tested Python version and dependency versions so PPT extraction and image processing are reproducible across environments. ]]>
