T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:12
- Finding
- Unpinned Global Installation of a Third-Party npm Package## Vulnerability Details **File Location**: `SKILL.md`, lines 12-16 **Vulnerability Type**: Unpinned third-party dependency installed globally **Risk Level**: Medium ```bash # 使用 npm 全局安装 npm install -g joycode-cli # 验证安装 joycode-cli --version ``` ### Technical Analysis The Skill instructs users or agents to globally install `joycode-cli` without specifying an exact version, integrity hash, lockfile, trusted registry URL, or verified publisher. The effective installed artifact can therefore change over time without any corresponding change to the reviewed Skill. npm packages may execute lifecycle scripts during installation. Because the package is installed globally, a compromised package release, compromised maintainer account, package ownership transfer, or malicious transitive dependency could execute code with the privileges of the user running npm and place files in globally accessible package or binary locations. The package implementation is not included in this project, so its installation behavior cannot be verified by this audit. ### Attack Path 1. An attacker compromises the `joycode-cli` npm package, its publisher account, or one of its install-time dependencies. 2. The attacker publishes a malicious release or alters a mutable dependency resolved by the package. 3. A user or agent follows the documented `npm install -g joycode-cli` command. 4. npm retrieves the current package release rather than a previously audited, fixed artifact. 5. Malicious lifecycle code executes during installation, or an attacker-controlled global CLI binary is installed. 6. Subsequent `joycode-cli` commands execute the compromised implementation. ### Impact Assessment Exploitation could provide arbitrary code execution with the permissions of the user invoking npm. Potential scope includes access to that user's files, source repositories, environment variables, npm configuration, and other credentials available to the proc ...[truncated 295 chars]
- Remediation
- ## Remediation Suggestions - Pin `joycode-cli` to an exact, reviewed version rather than installing the latest mutable release. - Document and verify the official npm package name, publisher identity, provenance, and expected registry URL. - Record and verify the package integrity digest before installation. - Prefer a project-local, lockfile-controlled installation over a global installation. - Review the package and its transitive dependencies, including npm lifecycle scripts, before use. - Disable lifecycle scripts with `--ignore-scripts` where compatible with the package. - Execute the CLI in a sandbox or container with restricted filesystem, network, credential, and repository access. - Avoid running npm or the CLI as root or another privileged account. - Establish an update-review process so newer releases are not consumed automatically.
