T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:136
- Finding
- Unpinned Third-Party Python Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:136-139`; also documented in `scripts/extract_text.py:7` and `scripts/extract_doc_text.py:7` **Vulnerability Type**: Supply-chain exposure through unpinned dependencies **Risk Level**: Medium ### Vulnerable Code `SKILL.md:136-139`: ```markdown ## Dependencies - Python 3.6+ - python-docx (`pip3 install python-docx`) - olefile (`pip3 install olefile`) — for .doc files only ``` `scripts/extract_text.py:7`: ```python Requires: pip3 install python-docx ``` `scripts/extract_doc_text.py:7`: ```python Requires: pip3 install olefile ``` ### Technical Analysis The installation instructions retrieve the latest package versions selected by the configured Python package index. No reviewed versions, integrity hashes, constraints file, or lock file are provided. Although `python-docx` and `olefile` are consistent with the scripts' declared functionality, installing mutable and unverified releases creates a supply-chain risk. Python package installation can execute package build or installation logic. Consequently, compromise of a package release, transitive dependency, package-index account, index configuration, or package resolution environment could result in arbitrary code execution during installation or when the dependency is imported. The audited project does not itself retrieve dependencies automatically, use an untrusted package index, or contain evidence that the named packages are malicious. Exploitation therefore depends on a compromise or manipulation of the external dependency supply chain. ### Attack Path 1. An attacker compromises a named package, one of its resolved dependencies, its publishing account, or the package index used by the victim. 2. The attacker publishes or causes resolution of a malicious release under the expected package name. 3. A user follows the documented unpinned command: - `pip3 install python-docx`, or - `pip3 install olefile`. 4. Pip resolves the attack ...[truncated 1010 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Create a dependency file containing explicitly reviewed versions of `python-docx`, `olefile`, and all required transitive dependencies. 2. Generate and verify cryptographic hashes for every approved distribution, then install with pip's `--require-hashes` option. 3. Replace the generic installation examples with a reproducible command such as: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Maintain separate lock files when different operating systems or Python versions require different distributions. 5. Install dependencies inside a dedicated virtual environment rather than globally or with administrative privileges. 6. Use the official Python package index over TLS, explicitly control index configuration, and avoid untrusted additional indexes. 7. Review dependency updates before changing locked versions, including package ownership, release provenance, dependency changes, and published artifacts. 8. Add automated dependency and vulnerability scanning to the release process while retaining manual review for package changes. ]]>
