T08 · Insecure Dependencies
- Location
COMMANDS.md:128- Finding
Unpinned Global Installation of a Privileged Infrastructure CLI
- Content
View full analysis
Run: `npm install -g hoist-cli` ``` `COMMANDS.md:128`: ```bash npm install -g hoist-cli@latest # Update to latest version ``` ### Technical Analysis The Skill instructs the agent to install `hoist-cli` globally without specifying a reviewed, immutable version. The explicit use of the mutable `latest` distribution tag makes the installed code dependent on the package registry state at execution time. No lockfile, package integrity hash, signature, provenance requirement, or version allowlist is provided. Consequently, the effective executable can change after this Skill has been audited. Global npm installation may also execute package lifecycle scripts with the permissions of the account running the agent. This is particularly sensitive because the installed CLI is intended to access cloud-provider credentials, connect to servers over SSH, create or destroy infrastructure, deploy applications, and manage databases and environment variables. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, the registry publication process, or a future release. 2. The attacker publishes a malicious version under the `latest` tag or otherwise changes the version resolved by the unpinned package request. 3. The agent follows the Skill instructions and executes: ```bash npm install -g hoist-cli ``` or: ```bash npm install -g hoist-cli@latest ``` 4. Malicious package installation code or the replaced CLI e ...[truncated 886 chars]- Remediation
View remediation
``` 2. Do not recommend `@latest` for automated or agent-driven installation. 3. Record and verify the expected package integrity hash or signed provenance before installation. 4. Maintain a version allowlist and require a separate review before updating it. 5. Prefer installation in an isolated environment rather than globally on the agent host. 6. Disable npm lifecycle scripts during installation where compatible: ```bash npm install -g --ignore-scripts hoist-cli@ ``` 7. If lifecycle scripts are required, review them and run installation with minimal filesystem and network permissions. 8. Use short-lived, least-privileged provider credentials so compromise of the CLI cannot grant unrestricted infrastructure access. ]]>
