T08 · Insecure Dependencies
Warning
- Location
- references/ocr-setup.md:26
- Finding
- Unpinned Third-Party OCR Dependency## Vulnerability Details **File Location**: `references/ocr-setup.md`, lines 26-29 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium **Vulnerable Code**: ```markdown **Install:** ```bash pip install easyocr ``` ``` ### Technical Analysis The documentation instructs users to install `easyocr` without specifying a reviewed version, validating package hashes, using a lockfile, or requiring an isolated environment. Consequently, package resolution depends on the mutable state of the configured Python package index at installation time. `easyocr` and its transitive dependencies are external code not included in this audit. If the package, one of its dependencies, the package index, or the user's package-index configuration is compromised, following this command could install attacker-controlled code. That code may execute during package installation or when the documented OCR workflow later imports and uses the package. This dependency is relevant to the Skill's OCR functionality, so its inclusion does not inherently exceed the functionality's required privileges. The issue is the absence of supply-chain integrity controls. ### Attack Path 1. An attacker compromises a dependency release, its publishing account, an upstream dependency, or a package index used by the victim. 2. The user follows the Skill's instructions and runs `pip install easyocr`. 3. Pip resolves the unpinned package and transitive dependencies from the compromised or unsafe source. 4. Attacker-controlled code is installed and may execute during installation or when the user imports `easyocr`. 5. The malicious code operates with the privileges of the user running pip and can access resources available to that account. ### Impact Assessment Successful exploitation can provide code execution with the installing user's privileges. The affected scope can include screenshots processed by the OCR workflow, othe ...[truncated 365 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `easyocr` and all transitive dependencies to reviewed versions using a lockfile or fully constrained requirements file. 2. Require hash verification, for example through `pip install --require-hashes -r requirements.txt`. 3. Direct users to create and activate a dedicated virtual environment before installation. 4. Explicitly use a trusted package index and warn users to review custom pip index configuration. 5. Periodically review and update pinned versions after vulnerability and provenance checks. 6. Document that OCR libraries process potentially sensitive screenshots and should only be installed from verified sources.
