T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:63
- Finding
- Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 63-67 **Vulnerability Type**: Unpinned and unverified third-party dependency **Risk Level**: Medium ### Vulnerable Code ```markdown Install if needed: ```bash pip install python-docx ``` ``` The dependency is subsequently imported in `scripts/md_to_word.py`, lines 17-24: ```python try: from docx import Document from docx.shared import Pt, Inches, Cm, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.table import WD_TABLE_ALIGNMENT from docx.oxml.ns import qn from docx.oxml import OxmlElement except ImportError: print("Error: python-docx is required. Install with: pip install python-docx") sys.exit(1) ``` ### Technical Analysis The installation instruction retrieves `python-docx` without pinning a reviewed version, validating package hashes, specifying a trusted package index, or using a dependency lock file. As a result, dependency resolution is mutable and depends on the package index and `pip` configuration present at installation time. This is a supply-chain weakness rather than evidence that the named package is currently malicious. Exploitation would require compromise or manipulation of an applicable package source, release, dependency, or package-resolution configuration. Malicious installation hooks could run during installation, while malicious package code could run when the converter imports the dependency. ### Attack Path 1. A user or Agent attempts to use the converter without `python-docx` installed. 2. The user follows the documented `pip install python-docx` instruction. 3. `pip` resolves content from its configured package source without a pinned version or required hash. 4. An attacker who has compromised or influenced that source or its resolution path supplies malicious package content. 5. Attacker-controlled code executes during installation or when `scripts/md_to_word.py` imports the installed package. ### Impact Asse ...[truncated 670 chars]
- Remediation
- ## Remediation Suggestions 1. Declare the dependency in a version-controlled requirements file using a reviewed, exact version. 2. Record and enforce cryptographic hashes, for example: ```text python-docx==REVIEWED_VERSION --hash=sha256:VERIFIED_DISTRIBUTION_HASH ``` 3. Install it with strict hash validation: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Generate hashes separately for every supported platform and artifact, or constrain installation to a specifically reviewed distribution. 5. Use an isolated virtual environment and avoid elevated installation. 6. Explicitly configure a trusted package index rather than relying on uncontrolled global or user-level `pip` settings. 7. Add automated dependency scanning and a controlled process for reviewing and updating pinned versions. 8. Update the script's `ImportError` message so it points to the verified requirements-based installation procedure instead of recommending the unpinned command.
