T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:49
- Finding
- Unpinned Global Installation of a Mutable npm Package## Vulnerability Details **File Location**: `SKILL.md:49` (repeated at `SKILL.md:249` and `SKILL.md:287`) **Vulnerability Type**: Supply-chain risk from an unpinned global dependency **Risk Level**: Medium ### Vulnerable Code ```sh glasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest ``` The same unsafe upgrade instruction is repeated later: ```sh npm install -g @glasser-ai/cli@latest ``` ### Technical Analysis The Skill instructs the Agent to install or upgrade `@glasser-ai/cli` globally using npm's mutable `latest` distribution tag. Because no exact version or integrity value is specified, the package contents executed during installation can differ from those reviewed when the Skill was audited. npm installation can execute package lifecycle scripts, including installation hooks, with the privileges of the user running npm. The `-g` option also modifies the user's global Node.js toolchain rather than creating an isolated, project-scoped installation. This behavior exceeds the minimum privileges needed for the Skill's core functionality because the document states that bundled MCP tools are available by default and that the CLI is optional. This finding does not establish that the current npm package is malicious. The vulnerability is the trust placed in a mutable remote package release and the automatic global installation process. ### Attack Path 1. An attacker compromises the npm package, its publisher account, the publication process, or another component of the package's dependency chain. 2. The attacker publishes a malicious version under the `latest` tag. 3. The Agent follows the Skill instruction when the CLI is missing or an update notice appears. 4. npm retrieves the then-current package and its dependency tree without enforcing a reviewed version or integrity value. 5. Malicious package lifecycle code executes during installation, or malicious CLI code executes when the Agent subs ...[truncated 941 chars]
- Remediation
- ## Remediation Suggestions 1. Prefer the bundled MCP tools and remove automatic CLI installation where the CLI is not required. 2. Require explicit user approval before installing or upgrading software, especially globally installed packages. 3. Pin the CLI to an exact reviewed version instead of using `@latest`, for example: ```sh npm install --global @glasser-ai/cli@0.1.2 ``` 4. Verify the package version, provenance, signatures where available, and expected integrity before installation. 5. Avoid global installation. Use an isolated project directory, a locked dependency file, a container, or another sandbox with restricted filesystem and network access. 6. Disable or tightly control npm lifecycle scripts when compatible with the package: ```sh npm install --ignore-scripts --save-exact @glasser-ai/cli@0.1.2 ``` This should only be used after confirming that the package does not legitimately require installation scripts. 7. Replace automatic update instructions at lines 249 and 287 with a controlled update process that reviews the target version before installation. 8. Run the CLI under a least-privileged account and expose only the credentials and files required for the specific operation.
