T08 · Insecure Dependencies
- Location
- SKILL.md:12
- Finding
- Unpinned Globally Installed Privileged npm Dependency## Vulnerability Details **File Location**: `SKILL.md`, lines 12–16 and 38–41 **Vulnerability Type**: Unpinned third-party dependency and unsafe global installation **Risk Level**: High ### Vulnerable Code ```yaml install: - kind: node package: "@moonpay/cli" bins: [mp] ``` ```bash # Install npm install -g @moonpay/cli ``` ### Technical Analysis The Skill installs `@moonpay/cli` without pinning an exact version or verifying a package integrity hash. Consequently, installation resolves whichever package version the npm registry currently serves. The global installation also exposes the `mp` executable system-wide for the current environment. This dependency is highly privileged in the context of the declared functionality: the documentation entrusts it with authentication credentials, wallet mnemonics and private keys, local transaction signing, and cryptocurrency transfers. npm lifecycle scripts and package runtime code can execute locally during installation or invocation. A compromised publisher account, registry response, future malicious release, or transitive dependency compromise could therefore introduce arbitrary code after the Skill itself has been reviewed. No evidence establishes that the current package is malicious. The vulnerability is the absence of dependency immutability and integrity controls around a security-critical executable. ### Attack Path 1. An attacker compromises the npm publisher, package release process, or a dependency in the package's supply chain. 2. The attacker publishes a malicious version under the legitimate `@moonpay/cli` package name. 3. A user follows the Skill and runs `npm install -g @moonpay/cli`. 4. npm resolves the attacker-controlled release because no exact version or integrity value is specified. 5. Malicious lifecycle or runtime code executes under the installing user's privileges. 6. When available, the code accesses MoonPay credentials, wallet ...[truncated 1022 chars]
- Remediation
- ## Remediation Suggestions - Pin `@moonpay/cli` to a specifically audited version rather than resolving the latest release. - Publish and verify a cryptographic integrity value for the approved package artifact. - Use a lockfile and reproducible installation process where the hosting framework supports them. - Verify the npm registry, package scope, publisher identity, provenance attestations, and signatures before installation. - Disable npm lifecycle scripts during installation where compatible, then explicitly run only reviewed setup steps. - Prefer a project-local or isolated installation over `npm install -g`, limiting the executable's scope and reducing tool-resolution ambiguity. - Run the CLI as an unprivileged dedicated user or inside a sandbox with access only to the required MoonPay configuration and wallet resources. - Keep unrelated credentials and high-value wallets outside the CLI's readable environment. - Require explicit user confirmation and independently verify recipient addresses, networks, amounts, fees, and transaction simulations before signing or broadcasting. - Establish a controlled update process in which every new dependency version is reviewed and tested before the pin is changed.
