T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:34
- Finding
- Execution of an Unpinned npm CLI Dependency## Vulnerability Details **File Location**: `SKILL.md`, lines 34-49, 87, 115-121, and 136 **Vulnerability Type**: Unpinned third-party executable dependency **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g mp-skills npx mp-skills --help npx mp-skills find <keyword> npx mp-skills list npx mp-skills add TencentCloudBase/awesome-miniprogram-skills --skill <skill-name> npx mp-skills setup ``` ### Technical Analysis The Skill instructs the Agent to install and execute `mp-skills` without specifying an exact package version, integrity hash, lockfile, or verified package provenance. Both the global npm installation and repeated `npx` invocations can resolve a package version from the npm registry at execution time. Consequently, the code that runs may differ from the version that was reviewed when this Skill was authored. If the npm package, its publisher account, or a transitive dependency is compromised, invoking these commands can execute attacker-controlled installation hooks or runtime code under the current user's account. The instructions also require `mp-skills setup`, which is expected to modify project and cloud configuration. This increases the potential effect of a dependency compromise because the executable may have access to source files, environment configuration, cloud credentials available to the process, and network connectivity. ### Attack Path 1. An attacker compromises the `mp-skills` npm package, its publisher account, or one of its transitive dependencies. 2. The attacker publishes a malicious release or dependency update under the package name currently resolved by npm. 3. An Agent follows `SKILL.md` and runs `npm install -g mp-skills` or an unpinned `npx mp-skills` command. 4. npm downloads and executes the attacker-controlled package code. 5. The malicious code runs with the invoking user's privileges and can inspect or modify accessible project files, configurat ...[truncated 690 chars]
- Remediation
- ## Remediation Suggestions - Pin `mp-skills` to an explicitly reviewed version, such as `npx mp-skills@X.Y.Z`. - Prefer a project-local development dependency governed by a committed lockfile instead of a global installation. - Install dependencies through `npm ci` so resolution follows the reviewed lockfile. - Verify npm package provenance, publisher identity, signatures where available, and expected integrity hashes. - Review transitive dependencies and lifecycle scripts before permitting execution. - Run the CLI in a restricted environment with only the minimum required filesystem, network, credential, and cloud permissions. - Require explicit user confirmation before commands that modify project files, databases, cloud functions, or environment configuration. - Document and verify the expected file and cloud-resource changes before and after setup.
