T08 · Insecure Dependencies
- Location
SKILL.md:10- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10–13
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumComplete Code Snippet
markdown ## Install ```bash npm i -g @kaspacom/defi-mcptext ### Technical Analysis The installation instruction retrieves the current release of `@kaspacom/defi-mcp` without specifying an exact version, lockfile, integrity hash, or other provenance verification. Consequently, the installed code can change after the Skill has been reviewed. npm packages may define lifecycle scripts that execute during installation. If the package, publisher account, or release pipeline is compromised, following this instruction could execute attacker-controlled code with the privileges of the user running npm. The global installation option (`-g`) also exposes the installed executable system-wide for that user's environment and may overwrite or take precedence over an existing command with the same name. The audit found no evidence that the named package is currently malicious. The vulnerability is the mutable, unverified dependency installation process and its resulting supply-chain exposure. ### Attack Path 1. An attacker compromises the npm publisher account, package release pipeline, or another component involved in distributing `@kaspacom/defi-mcp`. 2. The attacker publishes a modified release containing a malicious npm lifecycle script or CLI implementation. 3. A user follows the documented `npm i -g @kaspacom/defi-mcp` instruction. 4. npm resolves the mutable current release because no exact version or integrity value is specified. 5. Malicious lifecycle code can execute during installation, or malicious behavior can execute when the globally installed CLI is later invoked. 6. The payload operates with the installing user's privileges and can access resources available to that account. ### Impact Assessment Successful exploitation could permit ...[truncated 640 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the package to an exact reviewed version, for example
@kaspacom/defi-mcp@X.Y.Z, rather than resolving a mutable latest release. - Publish the expected package provenance, official registry location, source repository, and integrity digest so users can verify the artifact before installation.
- Prefer a project-local installation governed by a committed lockfile instead of global installation.
- Use npm provenance and signature verification where supported, and review package ownership and release history before upgrades.
- Evaluate installation with lifecycle scripts disabled, such as
npm install --ignore-scripts, when package functionality permits it. - Run the CLI as an unprivileged, isolated account or inside a constrained container, with no unnecessary access to wallets, secrets, or sensitive files.
- Establish a controlled update process in which each new dependency release is reviewed before the pinned version is changed.
- Pin the package to an exact reviewed version, for example
