T08 · Insecure Dependencies
Error
- Location
- SKILL.md:10
- Finding
- Unpinned External CLI Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:10-12` **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: High ### Vulnerable Code ```bash npm install -g @tiktok-fe/skills # or: npx @tiktok-fe/skills [command] ``` ### Technical Analysis The skill directs AI agents to install or execute `@tiktok-fe/skills` without specifying an exact package version, lockfile, or integrity hash. Consequently, npm resolves a mutable package release at execution time. The `npx` form can download and immediately execute package code. The global installation form may also run package lifecycle scripts and makes the resolved CLI persistently available in the user's environment. The audited project contains only documentation and does not include the external CLI's source code, so its effective behavior cannot be verified from this artifact. This creates a supply-chain trust boundary: a compromised package account, malicious replacement release, registry compromise, or incompatible future version could cause agents following these instructions to execute code that was not present during the skill audit. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, or the package publication process. 2. The attacker publishes a malicious release under the same unpinned package name. 3. An AI agent loads this skill and follows the documented installation command. 4. npm resolves the attacker-controlled release because no exact version or integrity value is specified. 5. Package lifecycle code or the downloaded CLI executes with the permissions of the agent user. 6. The malicious package can access files, environment variables, network resources, and writable agent configuration directories available to that user. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the invoking user's privileges. The affected scope may include the current project, user-owned files, environm ...[truncated 411 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to an audited exact version, for example: ```bash npm install -g @tiktok-fe/skills@X.Y.Z npx --yes @tiktok-fe/skills@X.Y.Z [command] ``` 2. Verify the package tarball against a documented cryptographic integrity hash before execution. 3. Prefer a project-local dependency governed by a committed lockfile instead of a global installation. 4. Audit the resolved package source, lifecycle scripts, transitive dependencies, and release provenance. 5. Disable lifecycle scripts where compatible: ```bash npm install --ignore-scripts ... ``` 6. Execute the CLI in a restricted environment with minimal filesystem access, sanitized environment variables, and constrained network access. 7. Establish a controlled update process that reviews new versions before changing the pinned version. ]]>
