T08 · Insecure Dependencies
- Location
SKILL.md:10- Finding
Unpinned Global npm Dependency Creates a Supply-Chain Execution Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10–13
Vulnerability Type: Unpinned third-party package installed globally
Risk Level: MediumVulnerable code:
markdown ## Install ```bash npm i -g @kaspacom/defi-mcptext ### Technical Analysis The installation command retrieves the package version currently selected by the npm registry rather than an exact, previously audited version. Consequently, the effective code installed by this Skill can change without any corresponding change to `SKILL.md`. npm packages can define lifecycle scripts that execute during installation. Because the package is installed globally, those scripts and the resulting CLI run with the permissions of the invoking user and can modify that user's environment. This creates a supply-chain risk if the package, a transitive dependency, the publisher account, or the registry delivery path is compromised. The audited file does not establish that `@kaspacom/defi-mcp` is currently malicious. The vulnerability is the mutable and unverified dependency installation process. ### Attack Path 1. An attacker compromises the npm publisher account, package, or one of its transitive dependencies. 2. The attacker publishes a malicious version that becomes the version resolved by the unpinned installation command. 3. A user follows the Skill instructions and runs `npm i -g @kaspacom/defi-mcp`. 4. npm downloads the attacker-controlled release and may execute its lifecycle scripts during installation. 5. Malicious code executes with the invoking user's permissions; the globally installed CLI can also execute attacker logic during later lending commands. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the privileges of the user running npm. This may permit access to that user's files, environment variables, CLI configuration, and wallet-related data available in the execution environmen ...[truncated 367 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to an exact version that has been independently reviewed, for example
@kaspacom/defi-mcp@X.Y.Z, rather than relying on a mutable distribution tag. - Verify the package against an expected integrity hash and document the trusted publisher, source repository, and npm registry.
- Prefer a project-local installation governed by a committed lockfile instead of modifying the user's global npm environment.
- Review both the direct package and its transitive dependencies before approving upgrades.
- Disable lifecycle scripts during installation with
--ignore-scriptswhen the package can operate without them. If scripts are required, inspect them before installation. - Execute the CLI in a restricted environment with least-privilege filesystem access and no unnecessary secrets or wallet material.
- Require explicit user review and confirmation of network, token, amount, destination, and transaction payload before signing or submitting any lending transaction.
- Pin the dependency to an exact version that has been independently reviewed, for example
