T08 · Insecure Dependencies
Error
- Location
- SKILL.md:18
- Finding
- Unpinned Global Installation of a Mutable Third-Party npm Package## Vulnerability Details **File Location**: `SKILL.md`, line 18 **Vulnerability Type**: Unpinned third-party package installation **Risk Level**: High ### Vulnerable Code ```bash npm install -g grok-image-cli ``` ### Technical Analysis The Skill instructs users to globally install `grok-image-cli` without specifying an audited package version or integrity hash. Consequently, the package resolved when the command is executed may differ from the package that existed when this Skill was reviewed. An npm installation can execute package lifecycle scripts under the privileges of the invoking user. Global installation also exposes the resulting executable throughout the user's environment. Although the document states that npm provenance is available, the installation command does not enforce provenance verification or bind the package to a reviewed release. The project contains only `SKILL.md`; the installed package's implementation and dependency graph are not included. Therefore, claims regarding credential handling, network destinations, and local data storage cannot be verified from the audited artifact. ### Attack Path 1. An attacker compromises the upstream npm package, a maintainer account, or a dependency used by a future package release. 2. The attacker publishes a malicious release under the existing package name. 3. A user follows the Skill and runs the unpinned global installation command. 4. npm resolves and downloads the malicious release. 5. Malicious lifecycle scripts or package code execute with the invoking user's privileges. 6. The globally installed `grok-img` executable can subsequently access files, environment variables, or credentials available to that user whenever invoked. ### Impact Assessment Successful exploitation could permit arbitrary code execution with the privileges of the user performing the installation. The malicious package could read user-accessible files and environment variables, steal API credentials, alter local c ...[truncated 212 chars]
- Remediation
- ## Remediation Suggestions - Pin the npm package to a specific audited version rather than resolving the latest release: ```bash npm install -g grok-image-cli@<reviewed-version> ``` - Record and verify the expected package integrity digest before installation. - Require verification of npm provenance and its association with a reviewed source commit. - Inspect package contents using `npm pack` before execution, including lifecycle scripts and bundled files. - Disable lifecycle scripts during initial inspection where compatible: ```bash npm install --ignore-scripts ``` - Prefer a project-local installation over a global installation to reduce exposure and simplify removal. - Re-audit the package and dependency graph whenever the pinned version is changed.
