T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:27
- Finding
- Unpinned Third-Party Dependencies Enable Mutable Supply-Chain Execution<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:27` - `README.md:52` - `requirements.txt:1-4` - `setup.py:39-44` **Vulnerability Type**: Unpinned and inconsistently constrained third-party dependencies **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:27`: ```bash npx clawhub@latest install liaogong-ocr ``` `README.md:52`: ```bash npx clawhub@latest install liaogong-ocr ``` `requirements.txt:1-4`: ```text easyocr>=1.7.0,<2.0.0 pytesseract>=0.3.10 Pillow>=10.0.0 numpy>=1.24.0 ``` `setup.py:39-44`: ```python install_requires=[ "easyocr>=1.7.0", "pytesseract>=0.3.10", "Pillow>=10.0.0", "numpy>=1.24.0", ], ``` ### Technical Analysis The documented `npx clawhub@latest` command downloads and executes the package release currently associated with the mutable `latest` tag. The effective code executed by users can therefore change after this skill has been reviewed, without any corresponding modification to the audited repository. The Python dependencies are also specified using version ranges or lower bounds rather than immutable versions and verified hashes. Consequently, two installations performed at different times can resolve to different dependency versions and transitive dependency graphs. There is also a constraint inconsistency: `requirements.txt` restricts EasyOCR to versions below 2.0.0, while `setup.py` has no upper bound. Installation through `pip install .` can therefore resolve a materially different dependency set from installation through `pip install -r requirements.txt`. No malicious upstream package or malicious payload was identified in the audited repository. The risk arises from allowing future or compromised upstream releases to enter the installation path without version or integrity verification. ### Attack Path 1. An attacker compromises an upstream package publisher, package registry account, dependency release process, or mutable distribution tag. 2. The attacker publishes a modi ...[truncated 1373 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the mutable `latest` reference with a reviewed exact version: ```bash npx clawhub@<reviewed-version> install liaogong-ocr ``` 2. Where supported, pin the npm package by integrity hash or use a lock file that records the resolved version and integrity metadata. 3. Pin direct and transitive Python dependencies through a reproducible lock file. Generate hash-verified requirements, for example: ```bash pip-compile --generate-hashes requirements.in pip install --require-hashes -r requirements.txt ``` 4. Align dependency constraints between `setup.py` and `requirements.txt`. In particular, apply the same reviewed EasyOCR upper bound in all installation configurations. 5. Prefer modern packaging metadata in `pyproject.toml` and maintain a separately generated, hash-locked deployment dependency file. 6. Use automated dependency monitoring, but require testing and security review before changing pinned versions. 7. Install dependencies inside an isolated virtual environment or container and avoid running package installation as an administrator or root user. 8. In CI/CD environments, minimize installation-time access to secrets and use restricted network and filesystem permissions to reduce the impact of a compromised dependency. ]]>
