T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:95
- Finding
- Unpinned Third-Party SDK Creates a Supply-Chain Exposure<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 95-96; additional installation guidance in `scripts/main.py`, lines 218-221 **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium ### Complete Code Snippet From `SKILL.md`, lines 95-96: ```markdown - Python 3.6+ - 依赖:`tencentcloud-sdk-python`(通过 `pip install tencentcloud-sdk-python` 安装) ``` Related guidance from `scripts/main.py`, lines 218-221: ```python print( "错误: 缺少依赖 tencentcloud-sdk-python,请执行: pip install tencentcloud-sdk-python", file=sys.stderr, ) ``` ### Technical Analysis The Skill directs users to install `tencentcloud-sdk-python` without specifying a reviewed version, lock file, integrity hash, or trusted package-index configuration. Consequently, the package version and its transitive dependency graph can change after this Skill has been audited. Python packages may execute code during installation and whenever imported. This script imports the SDK immediately before reading and using Tencent Cloud credentials. A compromised future package release, compromised package index, unsafe index configuration, or malicious transitive dependency could therefore execute with the same privileges as the user running the Skill. The package name itself matches the declared Tencent Cloud dependency, so there is no evidence of intentional typosquatting or a presently malicious package. The issue is the absence of reproducible and integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises a future SDK or transitive dependency release, or influences the package source used by the victim's Python environment. 2. A user follows the documented `pip install tencentcloud-sdk-python` instruction. 3. The package manager resolves and installs the attacker-controlled version because no version or hash is constrained. 4. Malicious code executes during installation or when the script imports the package. 5. The malicious dependency can ...[truncated 824 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the SDK and all transitive dependencies to reviewed versions in a lock file. 2. Use hash-verified installation, such as a requirements file containing `--hash` entries and installation with `pip install --require-hashes`. 3. Explicitly use the official Python package index or an organization-controlled, authenticated package mirror. 4. Install the dependency in a dedicated virtual environment with no unnecessary packages. 5. Add automated dependency vulnerability and provenance scanning to the release process. 6. Upgrade dependencies through a controlled review process rather than resolving the newest available versions at runtime. 7. Run the Skill under a minimally privileged operating-system account and use Tencent Cloud credentials restricted to only the required OCR operations. ]]>
