T08 · Insecure Dependencies
- Location
SKILL.md:29- Finding
Unpinned Global npm Package Installation Creates a Supply-Chain Risk
- Content
View full analysis
7 days ago) npm outdated -g @hopkin/cli && npm install -g @hopkin/cli@latest ``` The update instructions repeat the unsafe installation of the mutable latest release: ```bash npm install -g @hopkin/cli@latest ``` ### Technical Analysis The Skill instructs the Agent to install a third-party npm package globally without pinning it to an audited version. It also directs the Agent to periodically install the package's mutable `latest` release. No lockfile, exact version, integrity hash, package signature, provenance validation, or preinstallation review is required. Consequently, the package installed when the Skill runs may differ from the package that existed when the Skill was audited. npm packages can also define lifecycle scripts that execute during installation. Global installation expands the effect beyond the project directory by modifying the user's global npm environment. The instructions do not request elevated privileges, so execution with administrative privileges is not assumed; nevertheless, package code and lifecycle scripts can run with the privileges of the user executing npm. ### Attack Path 1. An attacker compromises the `@hopkin/cli` package, its publisher account, an upstream dependency, or a future release distributed through the configured npm registry. 2. The compromised release is published under the version selected by an unpinned install or assigned the `latest` distribution tag. 3. Following the Skill instructions, the Agent runs `npm install -g @hopkin/cli` or `npm install -g @hopkin/cli@latest`. 4. npm retrieves the mutable package release and its dependency graph. 5. Malicious package code or npm ...[truncated 873 chars]- Remediation
View remediation
``` 7. Execute the CLI in a restricted environment with access only to the credentials and files required for the requested advertising query. ]]>
