T08 · Insecure Dependencies
Error
- Location
- references/install-and-setup.md:13
- Finding
- Unpinned Global Installation of a Wallet-Enabled Financial CLI<![CDATA[ ## Vulnerability Details **File Location**: `references/install-and-setup.md:13-22` **Vulnerability Type**: Supply-chain exposure through an unpinned third-party package **Risk Level**: High ### Vulnerable Code Snippet ```markdown ## Global install lifecycle Install: ```bash npm install -g @trends-fun/trends-skill-tool ``` Upgrade: ```bash npm update -g @trends-fun/trends-skill-tool ``` ``` ### Technical Analysis The installation instructions resolve and globally install the currently published version of `@trends-fun/trends-skill-tool` rather than a reviewed, immutable version. No exact version, package integrity hash, lockfile, publisher verification procedure, or reproducible-build validation is specified. A global npm installation may execute package lifecycle scripts with the privileges of the user running npm. The installed CLI is subsequently intended to interact with Solana wallet files, RPC endpoints, token creation, trading, and reward claims. Consequently, compromise of the npm package, its publisher account, or one of its transitive dependencies could introduce code that runs before the user has an opportunity to inspect it. The audit artifact contains only documentation and evaluations; it does not contain the npm package implementation or dependency metadata. The safety of the externally installed package therefore could not be independently verified in this audit. ### Attack Path 1. An attacker compromises the package publisher account, npm package, or a transitive dependency. 2. The attacker publishes a malicious release under the legitimate package name. 3. A user follows the documented `npm install -g` or `npm update -g` command. 4. npm resolves the mutable current release and may execute malicious lifecycle scripts during installation. 5. The malicious code executes with the installing user's privileges. 6. It may inspect user-accessible files and configuration, interfere with later CLI operations, alter transaction para ...[truncated 979 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin installation to a reviewed exact version, for example: ```bash npm install -g @trends-fun/trends-skill-tool@X.Y.Z ``` 2. Publish and document the expected npm integrity value, package digest, and verified publisher identity. 3. Prefer a lockfile-backed local installation or another reproducible deployment mechanism over resolving mutable global dependencies. 4. Document a release-verification process covering: - Package provenance. - Signed release artifacts. - Dependency changes. - Lifecycle scripts. - Published package contents. 5. Test upgrades in an isolated environment before allowing the new version to access a production wallet. 6. Run the CLI under a dedicated, least-privileged operating-system account and use a low-value wallet where feasible. 7. Avoid elevated npm installation privileges. If global installation is unavoidable, configure a user-owned npm prefix rather than using administrative execution. 8. Provide a rollback procedure pinned to the last reviewed version. ]]>
