T08 · Insecure Dependencies
Warning
- Location
- install.sh:44
- Finding
- Unpinned Python Dependency Installed into the System-Managed Environment## Vulnerability Details **File Location**: `install.sh:44-48` **Vulnerability Type**: Unpinned third-party dependency installation and bypass of system package protections **Risk Level**: Medium **Vulnerable Code**: ```bash if python3 -m pip install python-docx --break-system-packages 2>/dev/null; then echo " ✅ python-docx installation completed" elif python3 -m pip install python-docx 2>/dev/null; then echo " ✅ python-docx installation completed" else ``` ### Technical Analysis The installation script downloads `python-docx` without specifying an audited version or verifying an integrity hash. The effective dependency content may therefore change between installations as package releases change. The preferred installation command also passes `--break-system-packages`. This option bypasses protections intended to prevent pip from modifying a Python environment managed by the operating system. Installing directly into that environment can replace or conflict with packages used by unrelated system applications. Related unpinned installation instructions also appear in `SKILL.md:17-23`, `SKILL.md:209-213`, `README.md:24-26`, and `skill.json:20-23`. ### Attack Path 1. A user executes `install.sh` to install the Skill. 2. The script asks pip to resolve the current `python-docx` package without a version constraint or integrity hash. 3. If the dependency source or a newly published dependency artifact has been compromised, pip downloads the affected artifact. 4. Package installation code runs with the privileges of the user executing the installer. 5. Because the preferred command uses `--break-system-packages`, the package is permitted to modify the system-managed Python environment. 6. Malicious dependency code can subsequently execute when `scripts/read_word.py` imports the `docx` module. This is a supply-chain exposure rather than evidence that the currently named package is m ...[truncated 610 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `python-docx` and its transitive dependencies to reviewed versions. 2. Record cryptographic hashes in a requirements lock file and install with hash enforcement: ```bash python3 -m venv .venv .venv/bin/python -m pip install --require-hashes -r requirements.txt ``` 3. Remove `--break-system-packages` and use a dedicated virtual environment so the Skill cannot alter the operating system's managed Python packages. 4. Use a trusted, explicitly configured package index and retain dependency artifacts or a lock file for reproducible installations. 5. Apply the same pinned installation instructions consistently in `SKILL.md`, `README.md`, and `skill.json`. 6. Run dependency vulnerability and provenance checks before publishing each release.
