Back to skill

Security audit

MoonPay

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned with MoonPay crypto operations, but it gives agents high-impact financial and wallet authority through an unpinned global CLI and does not consistently require user confirmation around irreversible actions.

Review this before installing. Use only in an isolated environment with wallets funded only for intended tasks, verify token addresses, chains, recipients, quotes, fees, and slippage manually, and require explicit human approval before signing, transferring, bridging, buying, paying, deleting wallets, exporting mnemonics, or installing additional skills. Prefer a pinned or otherwise verified @moonpay/cli version over the unpinned global install.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Error
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.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Credential Access

High
Category
Privilege Escalation
Content
## Authentication

**CLI:** Run `mp login --email you@example.com` to open a browser page with hCaptcha. After solving the captcha, a verification code is sent to your email. Run `mp verify --email you@example.com --code 123456`. Credentials are stored encrypted at `~/.config/moonpay/credentials.json` and auto-refresh. Run `mp logout` to clear stored credentials.

**REST API:** Use a Bearer token in the `Authorization` header. Obtain tokens via the login/verify flow or OAuth 2.0 with PKCE.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill guides users through login, wallet creation, token search, balances, and REST API use for financial operations, but it does not consistently present prominent user-facing warnings about irreversible blockchain transactions, phishing/token-address mistakes, KYC/account implications, or safe handling of auth tokens and wallet material. In a crypto-onramp skill, omission of these warnings increases the chance of user harm through operator error even if no malicious behavior is intended.

Session Persistence

Medium
Category
Rogue Agent
Content
# Open the URL, solve captcha, get code from email
mp verify --email you@example.com --code 123456

# Create a wallet
mp wallet create --name main

# List tools
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

External Transmission

Medium
Category
Data Exfiltration
Content
### Option C: REST API

```bash
curl -X POST https://agents.moonpay.com/api/tools/token_search \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "SOL", "chain": "solana", "limit": 5}'
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The wallet, transfer, bridge, export, delete, signing, and send commands include destructive or irreversible actions, but the documentation does not consistently warn users before exposing commands that can permanently lose funds or secret material. This is especially risky because the skill targets AI agents and MCP integrations, where users may assume examples are safe defaults and execute them with minimal review.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
1. **Always simulate first** — call with `"simulation": true` to get a quote
2. **Show the quote** — display expected output, fees, slippage
3. **Get explicit confirmation** — never auto-execute without user approval
4. **Execute** — call with `"simulation": false` only after confirmation

---
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Static analysis

No suspicious patterns detected.