T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:25
- Finding
- Unpinned Global Installation of a Third-Party npm Package## Vulnerability Details **File Location**: `SKILL.md`, lines 25-29 **Vulnerability Type**: Unpinned third-party dependency installed globally **Risk Level**: Medium ```bash If the CLI is not installed, install it: ```bash npm install -g google-analytics-cli ``` ``` ### Technical Analysis The skill instructs the agent to install `google-analytics-cli` globally from the npm registry without specifying an exact version or verifying package integrity. Consequently, the code installed and executed can change after the skill has been reviewed. A global npm installation can execute package lifecycle scripts, including `preinstall`, `install`, and `postinstall`, with the permissions of the user running the agent. The absence of a pinned version, lockfile, integrity hash, or provenance verification exposes the installation to upstream package compromise, malicious releases, and registry or maintainer-account compromise. The package name corresponds to the tool declared by the skill, so the dependency is functionally relevant rather than obviously unrelated. Nevertheless, global installation exceeds the minimum practical privilege needed to invoke a reporting CLI because it changes the user's persistent tool environment and may expose credentials and files available to the agent process. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, or its publishing pipeline and publishes a malicious version under the existing package name. 2. The agent loads this skill on a host where the CLI is not already installed. 3. Following the skill instructions, the agent runs `npm install -g google-analytics-cli`. 4. npm resolves the current registry-selected version because no exact version or integrity value is provided. 5. Malicious package code or lifecycle scripts execute with the privileges of the user running the agent. 6. The payload can inspect accessible files and environment variables, potentially including Google Application Default C ...[truncated 1240 chars]
- Remediation
- ## Remediation Suggestions 1. Do not automatically install the dependency. Ask the user for explicit approval before changing the environment. 2. Pin the package to a reviewed exact version, for example: ```bash npm install --global --ignore-scripts google-analytics-cli@<reviewed-exact-version> ``` 3. Verify the selected release against trusted provenance, checksums, signatures, and the official project repository before installation. 4. Prefer an isolated, non-global environment, such as a dedicated container or temporary project directory with a lockfile. 5. Use `--ignore-scripts` where compatible to prevent dependency lifecycle scripts from executing during installation. 6. Run the CLI as an unprivileged user and never invoke the installation through `sudo`. 7. Restrict filesystem and environment access so the CLI can access only the selected GA4 credential and required network endpoints. 8. Require service-account credentials with GA4 Viewer access only, limited to the specific properties needed for the requested report. 9. Avoid passing credential contents through command-line arguments or displaying them in logs. Accept only a path selected or approved by the user. 10. Document a trusted package version and update it only after a fresh security review.
