T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:18
- Finding
- Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, line 18 **Vulnerability Type**: Unpinned third-party dependency and unsafe package resolution **Risk Level**: Medium **Complete Code Snippet**: ```bash python3 -m venv .venv . .venv/bin/activate python -m pip install dashscope ``` ### Technical Analysis The Skill instructs users to install `dashscope` without an exact version, integrity hashes, a lock file, or an explicitly trusted package index. Consequently, the installed package and its transitive dependencies may change after this Skill has been reviewed. Pip may also use indexes configured in the user's environment. If a package release, transitive dependency, package-publishing account, or configured index is compromised, following this instruction could install attacker-controlled code. Using a virtual environment limits direct modification of system Python packages, but it does not prevent malicious installation hooks or subsequently imported package code from operating with the invoking user's permissions. ### Attack Path 1. An attacker compromises the `dashscope` distribution, one of its transitive dependencies, a package publisher, or a package index used by the victim. 2. The victim follows the prerequisite and runs `python -m pip install dashscope`. 3. Pip resolves the mutable, unpinned package graph from the active index configuration. 4. The compromised artifact is installed into the virtual environment. 5. Malicious installation behavior or package code executes with the privileges of the user running pip or invoking the installed SDK. ### Impact Assessment Successful exploitation could provide code execution with the invoking user's privileges. Subject to those privileges, attacker-controlled code could access project files, environment variables—including `DASHSCOPE_API_KEY` if exported—user-readable credentials, and network resources. It could also alter files writable ...[truncated 320 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `dashscope` to a specific version that has been reviewed: ```bash python -m pip install "dashscope==<reviewed-version>" ``` 2. Provide a locked requirements file containing exact versions for direct and transitive dependencies. 3. Generate and verify cryptographic hashes, then install with `--require-hashes`. 4. Explicitly use an organization-approved or official trusted package index rather than inheriting arbitrary user index configuration. 5. Add an upgrade process requiring security review, integrity verification, and automated vulnerability scanning before changing pinned versions. 6. Retain the virtual-environment recommendation and explicitly warn users not to run the installation as root or with elevated privileges. 7. Avoid exposing `DASHSCOPE_API_KEY` in the installation process, and use a narrowly scoped credential wherever the service supports such scoping.
