T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:19
- Finding
- Unpinned Third-Party Package Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 19–23 **Vulnerability Type**: Supply-chain risk from an unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash pip install poocr ``` ### Technical Analysis The skill directs users to install `poocr` from the package index configured for `pip` without specifying a reviewed version, verifying cryptographic hashes, using a lockfile, or documenting a trusted source. Consequently, the package and its transitive dependencies may change independently of the reviewed skill. Python package installation can execute package-controlled build or installation logic. If the package publisher, distribution account, package index, or a transitive dependency is compromised, following this instruction could execute attacker-controlled code. The risk may also increase when an untrusted or incorrectly configured package index is in use. This finding establishes an unsafe dependency-management practice; it does not establish that the current `poocr` release is malicious. ### Attack Path 1. An attacker compromises the package publisher, a transitive dependency, or the package distribution channel and publishes a malicious release. 2. A user follows the skill's unpinned `pip install poocr` instruction. 3. `pip` resolves the attacker-controlled release because no version or hash is enforced. 4. Malicious package code executes during installation, import, or OCR processing. 5. The code accesses resources available to the process, potentially including invoice files and Tencent Cloud credentials supplied later by the user. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the user running `pip` or the Python process. The accessible scope may include local documents, invoice data, environment variables, cloud API credentials, output files, and network resources available to that account. Installation with e ...[truncated 66 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `poocr` and every transitive dependency to versions that have been reviewed and tested. 2. Store dependencies in a lockfile or requirements file containing cryptographic hashes, and install with hash enforcement: ```bash pip install --require-hashes -r requirements.txt ``` 3. Document the package's verified publisher, official repository, and expected package index. 4. Use an explicitly configured trusted index rather than relying on ambient `pip` configuration. 5. Review package source and release artifacts before approving upgrades, and use automated dependency and provenance scanning. 6. Install and run the package in an isolated virtual environment or restricted container under a non-privileged account. 7. Provide Tencent Cloud credentials with the minimum permissions required, avoid embedding them in source code, and rotate them if package compromise is suspected.
