T08 · Insecure Dependencies
Error
- Location
- SKILL.md:29
- Finding
- Mutable Global Installation of an Unpinned CLI Dependency<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:29-30` **Vulnerability Type**: Supply-chain exposure through an unpinned, globally installed dependency **Risk Level**: High ### Complete Code Snippet ```bash npm install -g @smartbi/cli@latest smartbi --version smartbi profile list --help ``` The same installation pattern is repeated in `references/init.md:9-10, 27, 37-38` and `README.md:71, 79-80`. ### Technical Analysis The Skill mandates installing `@smartbi/cli@latest` globally. The `latest` tag is mutable, so the code installed during a future Skill invocation may differ from the version that was reviewed. The subsequent version check only verifies that the installed release is at least version 2.0.0; it does not verify an exact version, package integrity, provenance, or expected cryptographic digest. A global npm installation may run package lifecycle scripts and places the resulting executable in a shared user or system execution path. Consequently, a compromised publisher account, registry response, package release, or dependency can execute code with the permissions of the user running the Agent. This installation method is broader than the minimum privilege necessary. A locally pinned, integrity-verified dependency would provide the required CLI functionality without modifying the global tool environment. ### Attack Path 1. An attacker compromises the npm package publisher, registry distribution path, or a transitive dependency. 2. The attacker publishes a malicious release and assigns it to the `latest` tag. 3. The Skill encounters a missing or outdated CLI and runs `npm install -g @smartbi/cli@latest`. 4. npm downloads and installs the attacker-controlled release, potentially executing lifecycle scripts. 5. The malicious package accesses local files, Smartbi configuration, tokens, environment variables, or Agent-accessible resources. 6. Future `smartbi` invocations continue to execute the globally installed compromised binary. ...[truncated 624 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin an exact audited version, for example `@smartbi/cli@2.x.y`, rather than using `latest`. 2. Verify the expected package integrity hash and package provenance before installation. 3. Use a lockfile and a trusted, explicitly configured npm registry. 4. Prefer a project-local or isolated installation over a global installation. 5. Disable lifecycle scripts where compatible, or review all lifecycle scripts before permitting execution. 6. Require explicit user approval before installing or upgrading executable dependencies. 7. Revalidate the package whenever the pinned version changes. 8. Verify both the exact version and the executable origin after installation. ]]>
