Back to skill

Security audit

LLM Wallet - x402 stabelcoin payments on Polygon

Security checks for vulnerabilities and agentic risk

Overview

This skill is openly for crypto wallet payments, but it relies on an unpinned external wallet package for sensitive money-handling operations.

Review this skill carefully before installing. Use only a dedicated testnet wallet or a low-balance wallet, pin and verify the llm-wallet-mcp package before running it, avoid global or elevated installs, keep private keys and WALLET_ENCRYPTION_KEY out of chats and repositories, and approve payments only after checking the destination URL, amount, network, and recipient.

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:5
Finding
Unpinned Third-Party Wallet Package Can Introduce Supply-Chain Code<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5`; supporting installation instructions at `README.md:27-28`, `README.md:199-202`, and `references/wallet-setup.md:7-14` **Vulnerability Type**: Unpinned security-sensitive third-party dependency **Risk Level**: High ### Vulnerable Code `SKILL.md:5`: ```yaml metadata: {"openclaw": {"emoji": "💰", "requires": {"bins": ["node"]}, "install": [{"id": "node", "kind": "node", "package": "llm-wallet-mcp", "bins": ["llm-wallet-mcp"], "label": "Install LLM Wallet MCP (node)"}]}} ``` `README.md:27-28`: ```bash # Install MCP server npm install -g llm-wallet-mcp ``` `README.md:199-202`: ```bash npm install -g llm-wallet-mcp # or npx llm-wallet-mcp ``` `references/wallet-setup.md:7-14`: ```bash npm install -g llm-wallet-mcp ``` ```bash npx llm-wallet-mcp ``` ### Technical Analysis The skill delegates all wallet and payment functionality to the external `llm-wallet-mcp` npm package without specifying an exact version, package integrity value, signature, or auditable lockfile. The `npx llm-wallet-mcp` instruction is particularly sensitive because it can retrieve the package's current registry release and execute it immediately. The repository contains documentation only and does not include the package implementation. Consequently, the audit cannot verify whether the distributed dependency correctly implements the documented AES-256-GCM wallet encryption, spending limits, approval checks, network defaults, private-key handling, or transaction-recipient validation. This dependency operates in a highly privileged security context. According to the documented functionality, it can import private keys, access the wallet encryption key, sign payment authorizations, initiate transactions, contact arbitrary paid APIs, and operate on Polygon mainnet with real USDC. An npm account compromise, malicious release, registry substitution, or unsafe transitive dependency could therefore introduce arbitrary code ...[truncated 2120 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `llm-wallet-mcp` to an exact reviewed version in both installation metadata and documentation; do not use ranges or unversioned package references. 2. Record and verify the expected npm integrity digest or signed release provenance before installation. 3. Publish or vendor the implementation source corresponding exactly to the distributed artifact so that private-key handling, payment authorization, limit enforcement, and network selection can be audited. 4. Replace direct `npx llm-wallet-mcp` instructions with installation of a pinned, verified artifact followed by execution of that installed artifact. 5. Audit and lock all transitive dependencies, and use automated dependency monitoring for publisher, ownership, integrity, and release changes. 6. Inspect packages with lifecycle scripts disabled before allowing installation scripts to execute. Avoid elevated installation privileges. 7. Run the wallet process in a least-privilege sandbox with restricted filesystem and network access. Expose only the specific wallet storage and approved service endpoints it requires. 8. Keep mainnet wallets separate from test wallets, enforce low on-chain allowances and application spending limits, and require an independently validated user confirmation immediately before every real-value payment. 9. Store encryption and signing keys in an operating-system key store, hardware-backed signer, or dedicated secret manager rather than broadly accessible process environments where practical. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (37)

Session Persistence

Medium
Category
Rogue Agent
Content
## Quick Start

### 1. Create Wallet
```bash
llm-wallet create --label "my-agent-wallet"
```
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
User: "Yes"

Agent executes: llm-wallet pay "https://api.weather.com/current?location=London"
```

## Usage in OpenClaw
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: "Yes"

Agent executes: llm-wallet pay "https://api.weather.com/current?location=London"
```

## Usage in OpenClaw
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: "Yes"

Agent executes: llm-wallet pay "https://api.weather.com/current?location=London"
```

## Usage in OpenClaw
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: "Yes"

Agent executes: llm-wallet pay "https://api.weather.com/current?location=London"
```

## Usage in OpenClaw
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
User: Yes, approved

Agent: [Executes: llm-wallet pay "https://api.translate.com/v1?text=hello&to=es"]
       Translation: "hola"
       Payment completed: 0.002 USDC
       Transaction: 0xabc123...
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The README instructs users to run `npx llm-wallet-mcp` without pinning a version, which allows execution of whatever package version is current at install time. This creates a supply-chain risk: a malicious or compromised future release could be fetched and executed unexpectedly in an environment that may have access to wallet data or secrets.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Make payment to weather API
llm-wallet pay "https://api.weatherapi.com/v1/current.json?q=London" \
  --method GET

# Response:
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Make POST request with JSON body
llm-wallet pay "https://api.image-gen.com/v1/generate" \
  --method POST \
  --body '{"prompt": "sunset over ocean", "size": "1024x1024"}'
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
### API Not Responding

```bash
llm-wallet pay "https://api.down-service.com/endpoint"
# Error: Network timeout after 3 retry attempts
#        Service may be temporarily unavailable
#        Try again later or check: https://status.down-service.com
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
# Shows mainnet balance

# Make mainnet payment
llm-wallet pay "https://api.mainnet-service.com/endpoint"
```

### Multiple Wallets
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
# Register multiple APIs
llm-wallet register-api "https://api.weather.com/v1" --name weather
llm-wallet register-api "https://api.translate.com/v1" --name translate
llm-wallet register-api "https://api.image.com/v1" --name image_gen

# List all registered
llm-wallet list-apis
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The documentation recommends running an unpinned package via `npx llm-wallet-mcp`, which fetches and executes whatever version is current at invocation time. In a wallet-management context, that creates a meaningful supply-chain risk: a compromised or maliciously updated package could gain access to wallet material, alter payment behavior, or exfiltrate secrets.

Session Persistence

Medium
Category
Rogue Agent
Content
## First Time Setup

### 1. Create Wallet
```bash
llm-wallet create --label "my-agent-wallet"
```
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.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The mainnet funding section warns that real money is involved but does not explicitly tell users to verify destination address, network, and the irreversibility of transfers. In a crypto wallet setup guide, that omission is safety-relevant because users may permanently lose funds by sending assets to the wrong address, wrong chain, or untrusted intermediary.

External Transmission

Medium
Category
Data Exfiltration
Content
"network": "polygon-amoy",
       "maxAmountRequired": "1000",  // 0.001 USDC
       "payTo": "0xCA3953e536bDA86D1F152eEfA8aC7b0C82b6eC00",
       "resource": "https://api.example.com/weather"
     }]
   }
   ```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"network": "polygon-amoy",
       "maxAmountRequired": "1000",  // 0.001 USDC
       "payTo": "0xCA3953e536bDA86D1F152eEfA8aC7b0C82b6eC00",
       "resource": "https://api.example.com/weather"
     }]
   }
   ```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"network": "polygon-amoy",
       "maxAmountRequired": "1000",  // 0.001 USDC
       "payTo": "0xCA3953e536bDA86D1F152eEfA8aC7b0C82b6eC00",
       "resource": "https://api.example.com/weather"
     }]
   }
   ```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"network": "polygon-amoy",
       "maxAmountRequired": "1000",  // 0.001 USDC
       "payTo": "0xCA3953e536bDA86D1F152eEfA8aC7b0C82b6eC00",
       "resource": "https://api.example.com/weather"
     }]
   }
   ```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.