T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Ambiguous and Unpinned Third-Party Dependencies Create a Supply-Chain Risk## Vulnerability Details **File Location**: `requirements.txt:1-6` **Vulnerability Type**: Dependency confusion, ambiguous package naming, and non-reproducible dependency resolution **Risk Level**: Medium ### Vulnerable Code ```text cv2 numpy opencv-python pil pillow realesrgan ``` The installation command documented in `SKILL.md:145-148` activates the vulnerable dependency resolution: ```bash # Python dependencies pip install -r requirements.txt ``` ### Technical Analysis The requirements file specifies every dependency without a fixed version or integrity hash. Consequently, package versions and artifacts are selected dynamically from the configured Python package index at installation time rather than from a reviewed, reproducible dependency set. The entries `cv2` and `pil` are particularly concerning because they are ambiguous or noncanonical names for the libraries used by the implementation. The canonical distributions, `opencv-python` and `pillow`, are already listed separately. Installing both names unnecessarily expands the supply-chain attack surface and may expose users to dependency confusion, typosquatting, or unrelated packages published under familiar import names. Python packages may execute attacker-controlled code during source builds or through malicious installation mechanisms. Therefore, an unsafe dependency can compromise the environment before the Skill itself is run. The `realesrgan` package is also installed unconditionally even though the documentation describes it as optional and the audited implementation only attempts to import `RealESRGANer`; it does not instantiate or use that component for upscaling. No evidence was found that the Skill's own Python code intentionally downloads a payload or performs malicious activity. The risk arises from the documented installation process and dependency manifest. ### Attack Path 1. A user or automated Agent follows the prerequisite in `SKILL.md` and runs `pip install -r requirements ...[truncated 1436 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the ambiguous duplicate dependencies: - Remove `cv2`; retain the reviewed canonical `opencv-python` distribution. - Remove `pil`; retain the reviewed canonical `pillow` distribution. 2. Pin every direct and transitive dependency to a reviewed version using a lock file generated by a dependency-management tool. 3. Add cryptographic hashes and install with hash verification, such as: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Move `realesrgan` into an explicit optional dependency group, or remove it until the implementation actually supports that engine. 5. Review package provenance, maintainer history, release signatures where available, and known vulnerability advisories before selecting versions. 6. Install dependencies in an isolated virtual environment or container under a nonprivileged account. 7. Configure pip to use an approved package index and prohibit unexpected fallback indexes. 8. Add automated dependency scanning and lock-file integrity checks to the release process.
