T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:48
- Finding
- Unpinned Tencent Cloud SDK Creates a Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md:48`; dependency imports occur at `scripts/main.py:151-158` **Vulnerability Type**: Unpinned third-party runtime dependency **Risk Level**: Medium **Vulnerable documentation snippet (`SKILL.md:48`):** ```text - Dependency: `tencentcloud-sdk-python` (install using `pip install tencentcloud-sdk-python`) ``` **Relevant runtime import snippet (`scripts/main.py:151-158`):** ```python try: from tencentcloud.common import credential from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.common.profile.http_profile import HttpProfile from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.ocr.v20181119 import ocr_client, models except ImportError: print("Error: missing dependency tencentcloud-sdk-python; run: pip install tencentcloud-sdk-python", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis The documented installation command does not constrain the SDK to a reviewed version and does not verify package integrity with hashes. Consequently, installations performed at different times may retrieve different package releases. The imported dependency executes in the same Python process as the Skill and is trusted without isolation. During normal execution, that process has access to `TENCENTCLOUD_SECRET_ID`, `TENCENTCLOUD_SECRET_KEY`, and the business-license image supplied for OCR. A malicious or compromised future package release could execute code during import or SDK initialization and access those credentials and document data. Exploitation depends on compromise of the package distribution channel, a malicious upstream release, or use of an untrusted package index; the reviewed project does not itself contain such a payload. The separately flagged Base64 behavior is not evidence of covert exfiltration. `scripts/main.py:68-99` encodes only the ...[truncated 1520 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `tencentcloud-sdk-python` to an explicitly reviewed version instead of installing the latest available release. 2. Maintain dependencies in a requirements or lock file and include cryptographic hashes, such as with pip's `--require-hashes` mode. 3. Install only from an explicitly configured, trusted package index over TLS; disable unintended supplemental indexes to reduce dependency-confusion exposure. 4. Review release notes and dependency changes before updating the pinned SDK version, and perform upgrades through a controlled process. 5. Run the Skill under a dedicated, minimally privileged account or isolated environment with restricted filesystem and outbound-network access. 6. Scope the Tencent Cloud credentials to only the OCR operations and resources required by this Skill, and rotate them if dependency compromise is suspected. 7. Avoid retaining credentials in broadly inherited environments; inject short-lived credentials into only the OCR process where operationally possible.
