T08 · Insecure Dependencies
- Location
SKILL.md:232- Finding
Unpinned Third-Party SDK Installation Creates a Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 232-237
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: MediumVulnerable Code
markdown ## Dependencies - Python 3.7+ - `tencentcloud-sdk-python` (Tencent Cloud SDK) Install the dependency manually: ```bash pip install tencentcloud-sdk-pythontext ### Technical Analysis The Skill instructs the Agent to install `tencentcloud-sdk-python` from the default Python package index without specifying an audited version, validating package hashes, using a lock file, or constraining the package source. Consequently, the code installed during different Skill executions may change without any corresponding change to the reviewed Skill package. If a future package release or its distribution channel is compromised, malicious installation or import-time code could execute with the privileges of the Agent process. This risk is particularly relevant because the SDK is imported by `scripts/main.py` after the user configures Tencent Cloud credentials. A compromised dependency could access environment variables including `TENCENTCLOUD_SECRET_ID`, `TENCENTCLOUD_SECRET_KEY`, and the optional `TENCENTCLOUD_TOKEN`. The audit found no evidence that the currently named package is malicious. The vulnerability is the uncontrolled dependency acquisition process. ### Attack Path 1. An attacker compromises the upstream SDK package, a maintainer account, or the package distribution channel. 2. A malicious package version is published under the expected package name. 3. The Agent follows the Skill instruction and runs: ```bash pip install tencentcloud-sdk-python- Because no version or hash is pinned, the package manager retrieves the uncontrolled malicious release.
- Malicious code executes during installation or when
scripts/main.pyimports the SDK. - The malicious dependency operates with the Agent process's permissions and may read configured cloud cred ...[truncated 752 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the dependency to a specifically reviewed version:
bash python3 -m pip install "tencentcloud-sdk-python==AUDITED_VERSION" -
Generate and maintain a lock file containing cryptographic hashes. Install with hash verification, for example:
bash python3 -m pip install --require-hashes -r requirements.txt -
Configure an explicitly trusted package index or an internally controlled package mirror rather than relying implicitly on the environment's default index.
-
Review dependency updates before changing the pinned version. Include vulnerability scanning and provenance verification in the update process.
-
Install the SDK in an isolated virtual environment with only the permissions required to invoke the moderation API.
-
Use short-lived Tencent Cloud credentials with a narrowly scoped policy that permits only the required TextModeration operation. Avoid broad, permanent cloud credentials.
-
Ensure credentials are introduced only at runtime and are not exposed during dependency installation where operationally possible.
-
